Put all LLVM code into the llvm namespace, as per bug 109.
authorBrian Gaeke <gaeke@uiuc.edu>
Tue, 11 Nov 2003 22:41:34 +0000 (22:41 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Tue, 11 Nov 2003 22:41:34 +0000 (22:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8

558 files changed:
autoconf/configure.ac
examples/ModuleMaker/ModuleMaker.cpp
examples/ModuleMaker/tools/ModuleMaker/ModuleMaker.cpp
include/Support/Annotation.h
include/Support/BitSetVector.h
include/Support/Casting.h
include/Support/CommandLine.h
include/Support/DOTGraphTraits.h
include/Support/Debug.h
include/Support/DepthFirstIterator.h
include/Support/DynamicLinker.h
include/Support/EquivalenceClasses.h
include/Support/FileUtilities.h
include/Support/GraphTraits.h
include/Support/GraphWriter.h
include/Support/LeakDetector.h
include/Support/MallocAllocator.h
include/Support/MathExtras.h
include/Support/PostOrderIterator.h
include/Support/SCCIterator.h
include/Support/STLExtras.h
include/Support/SetOperations.h
include/Support/Signals.h
include/Support/Statistic.h
include/Support/StringExtras.h
include/Support/SystemUtils.h
include/Support/Timer.h
include/Support/Tree.h
include/Support/TypeInfo.h
include/Support/VectorExtras.h
include/Support/ilist
include/llvm/ADT/BitSetVector.h
include/llvm/ADT/DepthFirstIterator.h
include/llvm/ADT/EquivalenceClasses.h
include/llvm/ADT/GraphTraits.h
include/llvm/ADT/PostOrderIterator.h
include/llvm/ADT/SCCIterator.h
include/llvm/ADT/STLExtras.h
include/llvm/ADT/SetOperations.h
include/llvm/ADT/Statistic.h
include/llvm/ADT/StringExtras.h
include/llvm/ADT/Tree.h
include/llvm/ADT/VectorExtras.h
include/llvm/ADT/ilist
include/llvm/AbstractTypeUser.h
include/llvm/Analysis/AliasAnalysis.h
include/llvm/Analysis/AliasSetTracker.h
include/llvm/Analysis/CallGraph.h
include/llvm/Analysis/ConstantsScanner.h
include/llvm/Analysis/DSGraph.h
include/llvm/Analysis/DSGraphTraits.h
include/llvm/Analysis/DSNode.h
include/llvm/Analysis/DSSupport.h
include/llvm/Analysis/DataStructure.h
include/llvm/Analysis/DataStructure/DSGraph.h
include/llvm/Analysis/DataStructure/DSGraphTraits.h
include/llvm/Analysis/DataStructure/DSNode.h
include/llvm/Analysis/DataStructure/DSSupport.h
include/llvm/Analysis/DataStructure/DataStructure.h
include/llvm/Analysis/DependenceGraph.h
include/llvm/Analysis/Dominators.h
include/llvm/Analysis/Expressions.h
include/llvm/Analysis/FindUnsafePointerTypes.h
include/llvm/Analysis/FindUsedTypes.h
include/llvm/Analysis/IPModRef.h
include/llvm/Analysis/InductionVariable.h
include/llvm/Analysis/InstForest.h
include/llvm/Analysis/Interval.h
include/llvm/Analysis/IntervalIterator.h
include/llvm/Analysis/IntervalPartition.h
include/llvm/Analysis/LoadValueNumbering.h
include/llvm/Analysis/LoopInfo.h
include/llvm/Analysis/MemoryDepAnalysis.h
include/llvm/Analysis/PgmDependenceGraph.h
include/llvm/Analysis/PostDominators.h
include/llvm/Analysis/SlotCalculator.h
include/llvm/Analysis/ValueNumbering.h
include/llvm/Analysis/Verifier.h
include/llvm/Argument.h
include/llvm/Assembly/AsmAnnotationWriter.h
include/llvm/Assembly/CWriter.h
include/llvm/Assembly/CachedWriter.h
include/llvm/Assembly/Parser.h
include/llvm/Assembly/PrintModulePass.h
include/llvm/Assembly/Writer.h
include/llvm/BasicBlock.h
include/llvm/Bytecode/Format.h
include/llvm/Bytecode/Primitives.h
include/llvm/Bytecode/Reader.h
include/llvm/Bytecode/WriteBytecodePass.h
include/llvm/Bytecode/Writer.h
include/llvm/CallGraphSCCPass.h
include/llvm/CodeGen/FunctionLiveVarInfo.h
include/llvm/CodeGen/InstrForest.h
include/llvm/CodeGen/InstrScheduling.h
include/llvm/CodeGen/InstrSelection.h
include/llvm/CodeGen/InstrSelectionSupport.h
include/llvm/CodeGen/LiveVariables.h
include/llvm/CodeGen/MachineBasicBlock.h
include/llvm/CodeGen/MachineCodeEmitter.h
include/llvm/CodeGen/MachineCodeForInstruction.h
include/llvm/CodeGen/MachineConstantPool.h
include/llvm/CodeGen/MachineFrameInfo.h
include/llvm/CodeGen/MachineFunction.h
include/llvm/CodeGen/MachineFunctionInfo.h
include/llvm/CodeGen/MachineFunctionPass.h
include/llvm/CodeGen/MachineInstr.h
include/llvm/CodeGen/MachineInstrAnnot.h
include/llvm/CodeGen/MachineInstrBuilder.h
include/llvm/CodeGen/Passes.h
include/llvm/CodeGen/SSARegMap.h
include/llvm/CodeGen/SchedGraphCommon.h
include/llvm/CodeGen/SelectionDAG.h
include/llvm/CodeGen/ValueSet.h
include/llvm/CodeGen/ValueTypes.h
include/llvm/Constant.h
include/llvm/ConstantHandling.h
include/llvm/Constants.h
include/llvm/DerivedTypes.h
include/llvm/ExecutionEngine/ExecutionEngine.h
include/llvm/ExecutionEngine/GenericValue.h
include/llvm/Function.h
include/llvm/GlobalValue.h
include/llvm/GlobalVariable.h
include/llvm/InstrTypes.h
include/llvm/Instruction.def
include/llvm/Instruction.h
include/llvm/Intrinsics.h
include/llvm/Linker.h
include/llvm/Module.h
include/llvm/ModuleProvider.h
include/llvm/Pass.h
include/llvm/PassAnalysisSupport.h
include/llvm/PassManager.h
include/llvm/PassSupport.h
include/llvm/SlotCalculator.h
include/llvm/Support/Annotation.h
include/llvm/Support/CFG.h
include/llvm/Support/CallSite.h
include/llvm/Support/Casting.h
include/llvm/Support/CommandLine.h
include/llvm/Support/ConstantRange.h
include/llvm/Support/DOTGraphTraits.h
include/llvm/Support/Debug.h
include/llvm/Support/DynamicLinker.h
include/llvm/Support/FileUtilities.h
include/llvm/Support/GraphWriter.h
include/llvm/Support/InstIterator.h
include/llvm/Support/InstVisitor.h
include/llvm/Support/LeakDetector.h
include/llvm/Support/Linker.h
include/llvm/Support/MallocAllocator.h
include/llvm/Support/Mangler.h
include/llvm/Support/MathExtras.h
include/llvm/Support/PassNameParser.h
include/llvm/Support/SystemUtils.h
include/llvm/Support/Timer.h
include/llvm/Support/ToolRunner.h
include/llvm/Support/TypeInfo.h
include/llvm/Support/ValueHolder.h
include/llvm/SymbolTable.h
include/llvm/SymbolTableListTraits.h
include/llvm/System/Signals.h
include/llvm/Target/MRegisterInfo.h
include/llvm/Target/TargetCacheInfo.h
include/llvm/Target/TargetData.h
include/llvm/Target/TargetFrameInfo.h
include/llvm/Target/TargetInstrInfo.h
include/llvm/Target/TargetMachine.h
include/llvm/Target/TargetMachineImpls.h
include/llvm/Target/TargetRegInfo.h
include/llvm/Target/TargetSchedInfo.h
include/llvm/Transforms/IPO.h
include/llvm/Transforms/Instrumentation.h
include/llvm/Transforms/MutateStructTypes.h
include/llvm/Transforms/Scalar.h
include/llvm/Transforms/Utils/BasicBlockUtils.h
include/llvm/Transforms/Utils/Cloning.h
include/llvm/Transforms/Utils/DemoteRegToStack.h
include/llvm/Transforms/Utils/Linker.h
include/llvm/Transforms/Utils/Local.h
include/llvm/Transforms/Utils/PromoteMemToReg.h
include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h
include/llvm/Type.def
include/llvm/Type.h
include/llvm/Use.h
include/llvm/User.h
include/llvm/Value.h
include/llvm/iMemory.h
include/llvm/iOperators.h
include/llvm/iOther.h
include/llvm/iPHINode.h
include/llvm/iTerminators.h
lib/Analysis/AliasAnalysis.cpp
lib/Analysis/AliasAnalysisCounter.cpp
lib/Analysis/AliasAnalysisEvaluator.cpp
lib/Analysis/AliasSetTracker.cpp
lib/Analysis/BasicAliasAnalysis.cpp
lib/Analysis/CFGPrinter.cpp
lib/Analysis/ConstantRange.cpp
lib/Analysis/DataStructure/BottomUpClosure.cpp
lib/Analysis/DataStructure/DSCallSiteIterator.h
lib/Analysis/DataStructure/DataStructure.cpp
lib/Analysis/DataStructure/DataStructureAA.cpp
lib/Analysis/DataStructure/DataStructureOpt.cpp
lib/Analysis/DataStructure/DataStructureStats.cpp
lib/Analysis/DataStructure/GraphChecker.cpp
lib/Analysis/DataStructure/IPModRef.cpp
lib/Analysis/DataStructure/Local.cpp
lib/Analysis/DataStructure/MemoryDepAnalysis.cpp
lib/Analysis/DataStructure/Parallelize.cpp
lib/Analysis/DataStructure/PgmDependenceGraph.cpp
lib/Analysis/DataStructure/Printer.cpp
lib/Analysis/DataStructure/Steensgaard.cpp
lib/Analysis/DataStructure/TopDownClosure.cpp
lib/Analysis/Expressions.cpp
lib/Analysis/IPA/CallGraph.cpp
lib/Analysis/IPA/CallGraphSCCPass.cpp
lib/Analysis/IPA/DependenceGraph.cpp
lib/Analysis/IPA/FindUnsafePointerTypes.cpp
lib/Analysis/IPA/FindUsedTypes.cpp
lib/Analysis/IPA/IPModRef.cpp
lib/Analysis/IPA/MemoryDepAnalysis.cpp
lib/Analysis/IPA/PgmDependenceGraph.cpp
lib/Analysis/IPA/PrintSCC.cpp
lib/Analysis/InductionVariable.cpp
lib/Analysis/InstCount.cpp
lib/Analysis/Interval.cpp
lib/Analysis/IntervalPartition.cpp
lib/Analysis/LiveVar/BBLiveVar.cpp
lib/Analysis/LiveVar/BBLiveVar.h
lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
lib/Analysis/LiveVar/ValueSet.cpp
lib/Analysis/LoadValueNumbering.cpp
lib/Analysis/LoopInfo.cpp
lib/Analysis/PostDominators.cpp
lib/Analysis/PrintSCC.cpp
lib/Analysis/ValueNumbering.cpp
lib/Archive/ArchiveReader.cpp
lib/AsmParser/Lexer.l
lib/AsmParser/Parser.cpp
lib/AsmParser/ParserInternals.h
lib/AsmParser/llvmAsmParser.y
lib/Bytecode/Archive/ArchiveReader.cpp
lib/Bytecode/Reader/ArchiveReader.cpp
lib/Bytecode/Reader/ConstantReader.cpp
lib/Bytecode/Reader/InstructionReader.cpp
lib/Bytecode/Reader/Reader.cpp
lib/Bytecode/Reader/ReaderInternals.h
lib/Bytecode/Reader/ReaderWrappers.cpp
lib/Bytecode/Writer/ConstantWriter.cpp
lib/Bytecode/Writer/InstructionWriter.cpp
lib/Bytecode/Writer/SlotCalculator.cpp
lib/Bytecode/Writer/SlotCalculator.h
lib/Bytecode/Writer/Writer.cpp
lib/Bytecode/Writer/WriterInternals.h
lib/CodeGen/InstrSched/InstrScheduling.cpp
lib/CodeGen/InstrSched/SchedGraph.cpp
lib/CodeGen/InstrSched/SchedGraph.h
lib/CodeGen/InstrSched/SchedGraphCommon.cpp
lib/CodeGen/InstrSched/SchedPriorities.cpp
lib/CodeGen/InstrSched/SchedPriorities.h
lib/CodeGen/InstrSelection/InstrForest.cpp
lib/CodeGen/InstrSelection/InstrSelection.cpp
lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp
lib/CodeGen/LiveVariables.cpp
lib/CodeGen/MachineCodeEmitter.cpp
lib/CodeGen/MachineCodeForInstruction.cpp
lib/CodeGen/MachineFunction.cpp
lib/CodeGen/MachineInstr.cpp
lib/CodeGen/MachineInstrAnnot.cpp
lib/CodeGen/ModuloScheduling/ModuloSchedGraph.cpp
lib/CodeGen/ModuloScheduling/ModuloSchedGraph.h
lib/CodeGen/ModuloScheduling/ModuloScheduling.cpp
lib/CodeGen/PHIElimination.cpp
lib/CodeGen/Passes.cpp
lib/CodeGen/PrologEpilogInserter.cpp
lib/CodeGen/RegAlloc/AllocInfo.h
lib/CodeGen/RegAlloc/IGNode.cpp
lib/CodeGen/RegAlloc/IGNode.h
lib/CodeGen/RegAlloc/InterferenceGraph.cpp
lib/CodeGen/RegAlloc/InterferenceGraph.h
lib/CodeGen/RegAlloc/LiveRange.h
lib/CodeGen/RegAlloc/LiveRangeInfo.cpp
lib/CodeGen/RegAlloc/LiveRangeInfo.h
lib/CodeGen/RegAlloc/PhyRegAlloc.cpp
lib/CodeGen/RegAlloc/PhyRegAlloc.h
lib/CodeGen/RegAlloc/RegAllocCommon.h
lib/CodeGen/RegAlloc/RegClass.cpp
lib/CodeGen/RegAlloc/RegClass.h
lib/CodeGen/RegAllocLocal.cpp
lib/CodeGen/RegAllocSimple.cpp
lib/CodeGen/SelectionDAG/DAGBuilder.cpp
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/ExecutionEngine/ExecutionEngine.cpp
lib/ExecutionEngine/Interpreter/Execution.cpp
lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
lib/ExecutionEngine/Interpreter/Interpreter.cpp
lib/ExecutionEngine/Interpreter/Interpreter.h
lib/ExecutionEngine/JIT/Intercept.cpp
lib/ExecutionEngine/JIT/JIT.cpp
lib/ExecutionEngine/JIT/JIT.h
lib/ExecutionEngine/JIT/JITEmitter.cpp
lib/ExecutionEngine/JIT/VM.cpp
lib/ExecutionEngine/JIT/VM.h
lib/Linker/LinkArchives.cpp
lib/Linker/LinkModules.cpp
lib/Support/Annotation.cpp
lib/Support/CommandLine.cpp
lib/Support/ConstantRange.cpp
lib/Support/Debug.cpp
lib/Support/DynamicLinker.cpp
lib/Support/FileUtilities.cpp
lib/Support/LeakDetector.cpp
lib/Support/Mangler.cpp
lib/Support/PluginLoader.cpp
lib/Support/Signals.cpp
lib/Support/Statistic.cpp
lib/Support/SystemUtils.cpp
lib/Support/Timer.cpp
lib/Support/ToolRunner.cpp
lib/Support/ValueHolder.cpp
lib/Target/CBackend/CBackend.cpp
lib/Target/CBackend/Writer.cpp
lib/Target/MRegisterInfo.cpp
lib/Target/SparcV9/EmitBytecodeToAssembly.cpp
lib/Target/SparcV9/InstrSched/InstrScheduling.cpp
lib/Target/SparcV9/InstrSched/SchedGraph.cpp
lib/Target/SparcV9/InstrSched/SchedGraph.h
lib/Target/SparcV9/InstrSched/SchedGraphCommon.cpp
lib/Target/SparcV9/InstrSched/SchedPriorities.cpp
lib/Target/SparcV9/InstrSched/SchedPriorities.h
lib/Target/SparcV9/InstrSelection/InstrForest.cpp
lib/Target/SparcV9/InstrSelection/InstrSelection.cpp
lib/Target/SparcV9/InstrSelection/InstrSelectionSupport.cpp
lib/Target/SparcV9/LiveVar/BBLiveVar.cpp
lib/Target/SparcV9/LiveVar/BBLiveVar.h
lib/Target/SparcV9/LiveVar/FunctionLiveVarInfo.cpp
lib/Target/SparcV9/LiveVar/ValueSet.cpp
lib/Target/SparcV9/MachineCodeForInstruction.h
lib/Target/SparcV9/MachineFunctionInfo.h
lib/Target/SparcV9/MachineInstrAnnot.h
lib/Target/SparcV9/MappingInfo.cpp
lib/Target/SparcV9/MappingInfo.h
lib/Target/SparcV9/ModuloScheduling/ModuloSchedGraph.cpp
lib/Target/SparcV9/ModuloScheduling/ModuloSchedGraph.h
lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp
lib/Target/SparcV9/RegAlloc/AllocInfo.h
lib/Target/SparcV9/RegAlloc/IGNode.cpp
lib/Target/SparcV9/RegAlloc/IGNode.h
lib/Target/SparcV9/RegAlloc/InterferenceGraph.cpp
lib/Target/SparcV9/RegAlloc/InterferenceGraph.h
lib/Target/SparcV9/RegAlloc/LiveRange.h
lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp
lib/Target/SparcV9/RegAlloc/LiveRangeInfo.h
lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp
lib/Target/SparcV9/RegAlloc/PhyRegAlloc.h
lib/Target/SparcV9/RegAlloc/RegAllocCommon.h
lib/Target/SparcV9/RegAlloc/RegClass.cpp
lib/Target/SparcV9/RegAlloc/RegClass.h
lib/Target/SparcV9/SparcV9.burg.in
lib/Target/SparcV9/SparcV9AsmPrinter.cpp
lib/Target/SparcV9/SparcV9CodeEmitter.cpp
lib/Target/SparcV9/SparcV9CodeEmitter.h
lib/Target/SparcV9/SparcV9InstrInfo.cpp
lib/Target/SparcV9/SparcV9InstrSelection.cpp
lib/Target/SparcV9/SparcV9InstrSelectionSupport.h
lib/Target/SparcV9/SparcV9Internals.h
lib/Target/SparcV9/SparcV9PeepholeOpts.cpp
lib/Target/SparcV9/SparcV9PreSelection.cpp
lib/Target/SparcV9/SparcV9PrologEpilogInserter.cpp
lib/Target/SparcV9/SparcV9RegClassInfo.cpp
lib/Target/SparcV9/SparcV9RegClassInfo.h
lib/Target/SparcV9/SparcV9RegInfo.cpp
lib/Target/SparcV9/SparcV9SchedInfo.cpp
lib/Target/SparcV9/SparcV9StackSlots.cpp
lib/Target/SparcV9/SparcV9TargetMachine.cpp
lib/Target/TargetData.cpp
lib/Target/TargetInstrInfo.cpp
lib/Target/TargetMachine.cpp
lib/Target/TargetSchedInfo.cpp
lib/Target/X86/FloatingPoint.cpp
lib/Target/X86/InstSelectPattern.cpp
lib/Target/X86/InstSelectSimple.cpp
lib/Target/X86/PeepholeOptimizer.cpp
lib/Target/X86/Printer.cpp
lib/Target/X86/X86.h
lib/Target/X86/X86AsmPrinter.cpp
lib/Target/X86/X86CodeEmitter.cpp
lib/Target/X86/X86FloatingPoint.cpp
lib/Target/X86/X86ISelPattern.cpp
lib/Target/X86/X86ISelSimple.cpp
lib/Target/X86/X86InstrBuilder.h
lib/Target/X86/X86InstrInfo.cpp
lib/Target/X86/X86InstrInfo.h
lib/Target/X86/X86PeepholeOpt.cpp
lib/Target/X86/X86RegisterInfo.cpp
lib/Target/X86/X86RegisterInfo.h
lib/Target/X86/X86TargetMachine.cpp
lib/Target/X86/X86TargetMachine.h
lib/Transforms/ExprTypeConvert.cpp
lib/Transforms/Hello/Hello.cpp
lib/Transforms/IPO/ConstantMerge.cpp
lib/Transforms/IPO/DeadArgumentElimination.cpp
lib/Transforms/IPO/DeadTypeElimination.cpp
lib/Transforms/IPO/ExtractFunction.cpp
lib/Transforms/IPO/FunctionResolution.cpp
lib/Transforms/IPO/GlobalDCE.cpp
lib/Transforms/IPO/IPConstantPropagation.cpp
lib/Transforms/IPO/InlineSimple.cpp
lib/Transforms/IPO/Inliner.cpp
lib/Transforms/IPO/Inliner.h
lib/Transforms/IPO/Internalize.cpp
lib/Transforms/IPO/LowerSetJmp.cpp
lib/Transforms/IPO/MutateStructTypes.cpp
lib/Transforms/IPO/Parallelize.cpp
lib/Transforms/IPO/PruneEH.cpp
lib/Transforms/IPO/RaiseAllocations.cpp
lib/Transforms/IPO/SimpleStructMutation.cpp
lib/Transforms/Instrumentation/BlockProfiling.cpp
lib/Transforms/Instrumentation/EmitFunctions.cpp
lib/Transforms/Instrumentation/ProfilePaths/CombineBranch.cpp
lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp
lib/Transforms/Instrumentation/ProfilePaths/Graph.cpp
lib/Transforms/Instrumentation/ProfilePaths/Graph.h
lib/Transforms/Instrumentation/ProfilePaths/GraphAuxiliary.cpp
lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp
lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp
lib/Transforms/Instrumentation/ProfilePaths/RetracePath.cpp
lib/Transforms/Instrumentation/TraceValues.cpp
lib/Transforms/LevelRaise.cpp
lib/Transforms/Scalar/ADCE.cpp
lib/Transforms/Scalar/ConstantProp.cpp
lib/Transforms/Scalar/CorrelatedExprs.cpp
lib/Transforms/Scalar/DCE.cpp
lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
lib/Transforms/Scalar/GCSE.cpp
lib/Transforms/Scalar/IndVarSimplify.cpp
lib/Transforms/Scalar/InstructionCombining.cpp
lib/Transforms/Scalar/LICM.cpp
lib/Transforms/Scalar/PRE.cpp
lib/Transforms/Scalar/PiNodeInsertion.cpp
lib/Transforms/Scalar/Reassociate.cpp
lib/Transforms/Scalar/SCCP.cpp
lib/Transforms/Scalar/ScalarReplAggregates.cpp
lib/Transforms/Scalar/SimplifyCFG.cpp
lib/Transforms/Scalar/SymbolStripping.cpp
lib/Transforms/Scalar/TailDuplication.cpp
lib/Transforms/Scalar/TailRecursionElimination.cpp
lib/Transforms/TransformInternals.cpp
lib/Transforms/TransformInternals.h
lib/Transforms/Utils/BasicBlockUtils.cpp
lib/Transforms/Utils/BreakCriticalEdges.cpp
lib/Transforms/Utils/CloneFunction.cpp
lib/Transforms/Utils/CloneModule.cpp
lib/Transforms/Utils/CloneTrace.cpp
lib/Transforms/Utils/DemoteRegToStack.cpp
lib/Transforms/Utils/InlineFunction.cpp
lib/Transforms/Utils/Linker.cpp
lib/Transforms/Utils/Local.cpp
lib/Transforms/Utils/LoopSimplify.cpp
lib/Transforms/Utils/LowerAllocations.cpp
lib/Transforms/Utils/LowerInvoke.cpp
lib/Transforms/Utils/LowerSwitch.cpp
lib/Transforms/Utils/Mem2Reg.cpp
lib/Transforms/Utils/PromoteMemoryToRegister.cpp
lib/Transforms/Utils/SimplifyCFG.cpp
lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
lib/Transforms/Utils/ValueMapper.cpp
lib/Transforms/Utils/ValueMapper.h
lib/VMCore/AsmWriter.cpp
lib/VMCore/BasicBlock.cpp
lib/VMCore/ConstantFold.cpp
lib/VMCore/ConstantFold.h
lib/VMCore/ConstantFolding.h
lib/VMCore/ConstantRange.cpp
lib/VMCore/Constants.cpp
lib/VMCore/Dominators.cpp
lib/VMCore/Function.cpp
lib/VMCore/InstrTypes.cpp
lib/VMCore/Instruction.cpp
lib/VMCore/LeakDetector.cpp
lib/VMCore/Linker.cpp
lib/VMCore/Mangler.cpp
lib/VMCore/Module.cpp
lib/VMCore/ModuleProvider.cpp
lib/VMCore/Pass.cpp
lib/VMCore/PassManagerT.h
lib/VMCore/SlotCalculator.cpp
lib/VMCore/SymbolTable.cpp
lib/VMCore/SymbolTableListTraitsImpl.h
lib/VMCore/Type.cpp
lib/VMCore/Value.cpp
lib/VMCore/Verifier.cpp
lib/VMCore/iBranch.cpp
lib/VMCore/iCall.cpp
lib/VMCore/iMemory.cpp
lib/VMCore/iOperators.cpp
lib/VMCore/iSwitch.cpp
projects/ModuleMaker/tools/ModuleMaker/ModuleMaker.cpp
projects/SmallExamples/ModuleMaker/tools/ModuleMaker/ModuleMaker.cpp
tools/analyze/AnalysisWrappers.cpp
tools/analyze/GraphPrinters.cpp
tools/analyze/PrintSCC.cpp
tools/analyze/analyze.cpp
tools/bugpoint/BugDriver.cpp
tools/bugpoint/BugDriver.h
tools/bugpoint/CodeGeneratorBug.cpp
tools/bugpoint/CrashDebugger.cpp
tools/bugpoint/ExecutionDriver.cpp
tools/bugpoint/ExtractFunction.cpp
tools/bugpoint/ListReducer.h
tools/bugpoint/Miscompilation.cpp
tools/bugpoint/OptimizerDriver.cpp
tools/bugpoint/TestPasses.cpp
tools/bugpoint/ToolRunner.cpp
tools/bugpoint/ToolRunner.h
tools/bugpoint/bugpoint.cpp
tools/extract/extract.cpp
tools/gccas/gccas.cpp
tools/gccld/GenerateCode.cpp
tools/gccld/Linker.cpp
tools/gccld/gccld.cpp
tools/gccld/gccld.h
tools/llc/llc.cpp
tools/lli/lli.cpp
tools/llvm-ar/llvm-ar.cpp
tools/llvm-as/llvm-as.cpp
tools/llvm-dis/llvm-dis.cpp
tools/llvm-extract/llvm-extract.cpp
tools/llvm-link/llvm-link.cpp
tools/llvm-nm/llvm-nm.cpp
tools/llvm-prof/ProfileInfo.cpp
tools/llvm-prof/ProfileInfo.h
tools/llvm-prof/llvm-prof.cpp
tools/opt/AnalysisWrappers.cpp
tools/opt/GraphPrinters.cpp
tools/opt/PrintSCC.cpp
tools/opt/opt.cpp
utils/TableGen/CodeEmitterGen.cpp
utils/TableGen/CodeEmitterGen.h
utils/TableGen/CodeGenTarget.cpp
utils/TableGen/CodeGenTarget.h
utils/TableGen/CodeGenWrappers.cpp
utils/TableGen/CodeGenWrappers.h
utils/TableGen/FileLexer.l
utils/TableGen/FileParser.y
utils/TableGen/InstrInfoEmitter.cpp
utils/TableGen/InstrInfoEmitter.h
utils/TableGen/InstrSelectorEmitter.cpp
utils/TableGen/InstrSelectorEmitter.h
utils/TableGen/Record.cpp
utils/TableGen/Record.h
utils/TableGen/RegisterInfoEmitter.cpp
utils/TableGen/RegisterInfoEmitter.h
utils/TableGen/TableGen.cpp
utils/TableGen/TableGenBackend.cpp
utils/TableGen/TableGenBackend.h

index 1ae8c1cdd8284069b86276df23d4378673463776..212a460ddb6ff0c434164a4794d9e3de75d9f723 100644 (file)
@@ -16,6 +16,7 @@ dnl **************************************************************************
 dnl * Initialize
 dnl **************************************************************************
 AC_INIT([[[LLVM]]],[[[1.0]]],[llvmbugs@cs.uiuc.edu])
+dnl AC_CONFIG_SRC_DIR(lib/VMCore/Pass.cpp)
 
 dnl Place all of the extra autoconf files into the config subdirectory
 AC_CONFIG_AUX_DIR([autoconf])
index 1d06c2d0dd0f880022a1254614cdfc332f883304..a1b68449f3bad7d743ac5a21221845cc6896b7d2 100644 (file)
@@ -12,6 +12,8 @@
 #include "llvm/Instructions.h"
 #include "llvm/Bytecode/Writer.h"
 
+using namespace llvm;
+
 int main() {
   // Create the "module" or "program" or "translation unit" to hold the
   // function
index 1d06c2d0dd0f880022a1254614cdfc332f883304..a1b68449f3bad7d743ac5a21221845cc6896b7d2 100644 (file)
@@ -12,6 +12,8 @@
 #include "llvm/Instructions.h"
 #include "llvm/Bytecode/Writer.h"
 
+using namespace llvm;
+
 int main() {
   // Create the "module" or "program" or "translation unit" to hold the
   // function
index 075ffc297a4b91a9d0b18cb6b1adf50aadb5d586..cee7ab7d8936ce8ef7c17d27031b263684a4394e 100644 (file)
@@ -25,6 +25,8 @@
 #include <string>
 #include <cassert>
 
+namespace llvm {
+
 class AnnotationID;
 class Annotation;
 class Annotable;
@@ -217,4 +219,6 @@ inline Annotation *Annotable::getOrCreateAnnotation(AnnotationID ID) const {
   return A;
 }
 
+} // End namespace llvm
+
 #endif
index 08bafa15806ae7a17e545167fcc6761c354dd7b0..72f55b38c4fb85b2d0328acf6360fdebc9ee1510 100644 (file)
@@ -30,6 +30,8 @@
 #include <functional>
 #include <iostream>
 
+namespace llvm {
+
 class BitSetVector {
   enum { BITSET_WORDSIZE = sizeof(long)*8 };
 
@@ -266,4 +268,5 @@ inline bool Disjoint(const BitSetVector& set1,
   return true;
 }
 
+} // End llvm namespace
 #endif
index 065919c1792a87c71cc491e3c464cb4418f1eeca..4b070c18d85a4d3a3a05cf60cd03b9a7163abe8b 100644 (file)
@@ -15,6 +15,8 @@
 #ifndef SUPPORT_CASTING_H
 #define SUPPORT_CASTING_H
 
+namespace llvm {
+
 //===----------------------------------------------------------------------===//
 //                          isa<x> Support Templates
 //===----------------------------------------------------------------------===//
@@ -293,4 +295,6 @@ void main() {
 
 #endif
 
+} // End llvm namespace
+
 #endif
index 01f55a81d455716cc8e8d82c652427834a90c1a6..df40d80070e2a6a5d941ad788e30233b103fa554 100644 (file)
@@ -27,6 +27,7 @@
 #include <cassert>
 #include "boost/type_traits/object_traits.hpp"
 
+namespace llvm {
 /// cl Namespace - This namespace contains all of the command line option
 /// processing machinery.  It is intentionally a short name to make qualified
 /// usage concise.
@@ -1022,4 +1023,6 @@ struct aliasopt {
 
 } // End namespace cl
 
+} // End namespace llvm
+
 #endif
index 002a78ec4f8bc4872db8ba9f675e3872826b5dcd..63837b7ddf699bfbf6bf3c1b03b63e67915cee71 100644 (file)
@@ -19,6 +19,8 @@
 
 #include <string>
 
+namespace llvm {
+
 /// DefaultDOTGraphTraits - This class provides the default implementations of
 /// all of the DOTGraphTraits methods.  If a specialization does not need to
 /// override all methods here it should inherit so that it can get the default
@@ -96,4 +98,6 @@ struct DefaultDOTGraphTraits {
 template <typename Ty>
 class DOTGraphTraits : public DefaultDOTGraphTraits {};
 
+} // End llvm namespace
+
 #endif
index 8cba05771fb4b8a3e7c42857cd3b1073aa319fae..66a208811ae0af117d433dc0a027c948fc0ad061 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef SUPPORT_DEBUG_H
 #define SUPPORT_DEBUG_H
 
+namespace llvm {
+
 // DebugFlag - This boolean is set to true if the '-debug' command line option
 // is specified.  This should probably not be referenced directly, instead, use
 // the DEBUG macro below.
@@ -57,4 +59,6 @@ bool isCurrentDebugType(const char *Type);
   do { if (DebugFlag && isCurrentDebugType(DEBUG_TYPE)) { X; } } while (0)
 #endif
 
+} // End llvm namespace
+
 #endif
index bb7673c83d415872a59d4422e4b647652c756bb8..c465f4e549eb5df61b200bff2661ad1aaf6965f4 100644 (file)
@@ -38,6 +38,8 @@
 #include <vector>
 #include <set>
 
+namespace llvm {
+
 // df_iterator_storage - A private class which is used to figure out where to
 // store the visited set.
 template<class SetType, bool External>   // Non-external set
@@ -223,5 +225,6 @@ idf_ext_iterator<T, SetTy> idf_ext_end(T G, SetTy &S) {
   return idf_ext_iterator<T, SetTy>::end(G, S);
 }
 
+} // End llvm namespace
 
 #endif
index 8f02708268e14e11d5a7b8ffdf42fba47eea7aa5..fec9a45296cee48827a46281988d5bb27137ed1e 100644 (file)
@@ -18,6 +18,8 @@
 
 #include <string>
 
+namespace llvm {
+
 /// LinkDynamicObject - Load the named file as a dynamic library
 /// and link it with the currently running process. Returns false
 /// on success, true if there is an error (and sets ErrorMessage
@@ -33,4 +35,6 @@ bool LinkDynamicObject (const char *filename, std::string *ErrorMessage);
 void *GetAddressOfSymbol (const char *symbolName);
 void *GetAddressOfSymbol (const std::string &symbolName);
 
+} // End llvm namespace
+
 #endif // SUPPORT_DYNAMICLINKER_H
index 01e8c5ef8209bd1d17916bde446724f3790f019f..46e626b69b585456001980dec42334d2662424a3 100644 (file)
@@ -20,6 +20,8 @@
 #include <map>
 #include <vector>
 
+namespace llvm {
+
 template <class ElemTy>
 class EquivalenceClasses {
   // Maps each element to the element that is the leader of its 
@@ -89,4 +91,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif
index 0dfa625362173a7e765f973ad54f86ea96004d48..c276ec7aaa6538b0aa3fb0683d353f4d13f24769 100644 (file)
@@ -17,6 +17,8 @@
 
 #include <string>
 
+namespace llvm {
+
 /// CheckMagic - Returns true IFF the file named FN begins with Magic. FN must
 /// name a readable file.
 ///
@@ -95,4 +97,6 @@ bool MakeFileExecutable (const std::string & Filename);
 ///
 bool MakeFileReadable (const std::string & Filename);
 
+} // End llvm namespace
+
 #endif
index 305f71e2800e470acfcb1abe7cb3b36fd8c7b321..4ff74176a7a5877679170c334d529c24f09cb264 100644 (file)
@@ -18,6 +18,8 @@
 #ifndef SUPPORT_GRAPHTRAITS_H
 #define SUPPORT_GRAPHTRAITS_H
 
+namespace llvm {
+
 // GraphTraits - This class should be specialized by different graph types...
 // which is why the default version is empty.
 //
@@ -76,4 +78,6 @@ struct Inverse {
   inline Inverse(GraphType &G) : Graph(G) {}
 };
 
+} // End llvm namespace
+
 #endif
index 2cb8fcc985a875e25c2d9dc24ae7a9cdc7dbc3b9..7e5aa80645b2439a7e329b537336abec8eb8f360 100644 (file)
@@ -28,6 +28,8 @@
 #include <vector>
 #include <iostream>
 
+namespace llvm {
+
 namespace DOT {  // Private functions...
   inline std::string EscapeString(const std::string &Label) {
     std::string Str(Label);
@@ -206,4 +208,6 @@ std::ostream &WriteGraph(std::ostream &O, const GraphType &G,
   return O;
 }
 
+} // End llvm namespace
+
 #endif
index b39e0b591106adf9311669413ae4a5bfb5cee15a..e2ce9c50beac954bc158833121cd9bce656de589 100644 (file)
@@ -23,6 +23,9 @@
 #define SUPPORT_LEAKDETECTOR_H
 
 #include <string>
+
+namespace llvm {
+
 class Value;
 
 struct LeakDetector {
@@ -83,4 +86,6 @@ private:
   static void checkForGarbageImpl(const std::string &Message);
 };
 
+} // End llvm namespace
+
 #endif
index 1ba25b0d65efd83e14df584bf9b1acd497fceda8..766a67fa22f1c5204c214be6c652e3534cb87814 100644 (file)
@@ -23,6 +23,8 @@
 #include <cstdlib>
 #include <memory>
 
+namespace llvm {
+
 template<typename T>
 struct MallocAllocator {
   typedef size_t size_type;
@@ -79,5 +81,6 @@ namespace std {
   };
 }
 
+} // End llvm namespace
 
 #endif
index ec742324b0083727c8d80ae2cf42eea75d163f64..74958fbc3570bc61d79c2678a043ba54d2e8fc1c 100644 (file)
@@ -16,6 +16,8 @@
 
 #include "Support/DataTypes.h"
 
+namespace llvm {
+
 inline unsigned log2(uint64_t C) {
   unsigned getPow;
   for (getPow = 0; C > 1; ++getPow)
@@ -33,4 +35,6 @@ inline bool isPowerOf2(int64_t C, unsigned &getPow) {
   return false;
 }
 
+} // End llvm namespace
+
 #endif
index 9309554f3287fb5d884beaa807276f2d1a5f31fe..d66c4b84c40240467f9d2c1439f770d1d4c773d5 100644 (file)
@@ -21,6 +21,8 @@
 #include <stack>
 #include <set>
 
+namespace llvm {
+
 template<class GraphT, class GT = GraphTraits<GraphT> >
 class po_iterator : public forward_iterator<typename GT::NodeType, ptrdiff_t> {
   typedef forward_iterator<typename GT::NodeType, ptrdiff_t> super;
@@ -149,4 +151,6 @@ public:
   inline rpo_iterator end()   { return Blocks.rend(); }
 };
 
+} // End llvm namespace
+
 #endif
index cf137cd473404e91fdd1a750220dbaa1de73cdd8..f21c7d162e5129fa713ad291e21080acb30e8d81 100644 (file)
@@ -26,6 +26,8 @@
 #include <vector>
 #include <map>
 
+namespace llvm {
+
 //===----------------------------------------------------------------------===//
 ///
 /// scc_iterator - Enumerate the SCCs of a directed graph, in
@@ -197,4 +199,6 @@ scc_iterator<T> scc_end(T G) {
   return scc_iterator<T>::end(G);
 }
 
+} // End llvm namespace
+
 #endif
index 28c46e3d99a0e3fd4749fa22849f82bf67acb1f2..06a15734a7b0149963c88b77ba8a29993a99fb0e 100644 (file)
@@ -21,6 +21,8 @@
 #include "Support/iterator"
 #include "boost/type_traits/transform_traits.hpp"
 
+namespace llvm {
+
 //===----------------------------------------------------------------------===//
 //     Extra additions to <functional>
 //===----------------------------------------------------------------------===//
@@ -278,4 +280,6 @@ inline tier<T1, T2> tie(T1& f, T2& s) {
   return tier<T1, T2>(f, s);
 }
 
+} // End llvm namespace
+
 #endif
index dc6e0d6029efa6e75857ddd5c1d75fa570879697..bb1e68e6b299c9cf443831403e4d5e3e8b850012 100644 (file)
@@ -15,6 +15,8 @@
 #ifndef SUPPORT_SETOPERATIONS_H
 #define SUPPORT_SETOPERATIONS_H
 
+namespace llvm {
+
 // set_union(A, B) - Compute A := A u B, return whether A changed.
 //
 template <class S1Ty, class S2Ty>
@@ -64,4 +66,6 @@ void set_subtract(S1Ty &S1, const S2Ty &S2) {
     S1.erase(*SI);
 }
 
+} // End llvm namespace
+
 #endif
index ce12301a15c508c98cf67b9df54387379a08a78d..0cbf398798a17741bdb81d545f7eba6d8bb239e2 100644 (file)
 
 #include <string>
 
+namespace llvm {
+
 // RemoveFileOnSignal - This function registers signal handlers to ensure that
 // if a signal gets delivered that the named file is removed.
 //
 void RemoveFileOnSignal(const std::string &Filename);
 
-#endif
+} // End llvm namespace
 
+#endif
index d69809ff186e54f1c5f2701e1b44e9290664f9b7..4e592d5832f8cffb424a0186634362847dd31a6f 100644 (file)
@@ -26,6 +26,8 @@
 
 #include <iosfwd>
 
+namespace llvm {
+
 // StatisticBase - Nontemplated base class for Statistic<> class...
 class StatisticBase {
   const char *Name;
@@ -78,4 +80,6 @@ public:
   const Statistic &operator-=(const DataType &V) { Value -= V; return *this; }
 };
 
+} // End llvm namespace
+
 #endif
index 2c50c1cd5be39b821e816d608210f298c8fcef89..2ebac81935cae59777898199f119060f9df7ed17 100644 (file)
@@ -18,6 +18,8 @@
 #include <string>
 #include <stdio.h>
 
+namespace llvm {
+
 static inline std::string utohexstr(uint64_t X) {
   char Buffer[40];
   char *BufPtr = Buffer+39;
@@ -95,4 +97,6 @@ static inline std::string ftostr(double V) {
   return Buffer;
 }
 
+} // End llvm namespace
+
 #endif
index ccde86cce697e81b53d79d6409f8e648cb477cff..c874d9932c05c45070c3425d82fd2308c5feee6a 100644 (file)
@@ -17,6 +17,8 @@
 
 #include <string>
 
+namespace llvm {
+
 /// isExecutableFile - This function returns true if the filename specified
 /// exists and is executable.
 ///
@@ -45,4 +47,7 @@ int RunProgramWithTimeout(const std::string &ProgramPath, const char **Args,
 /// wait for it to terminate.
 ///
 int ExecWait (const char * const argv[], const char * const envp[]);
+
+} // End llvm namespace
+
 #endif
index 57ef3f0d6489a86d6bd7917c05701ea0b891a85d..ac465bb95b2d5eadbd909490997500985afb8dd8 100644 (file)
@@ -20,6 +20,8 @@
 #include <iosfwd>
 #include <cassert>
 
+namespace llvm {
+
 class TimerGroup;
 
 /// Timer - This class is used to track the amount of time spent between
@@ -157,4 +159,6 @@ private:
   }
 };
 
+} // End llvm namespace
+
 #endif
index e6454317a8c9fd15cf36d5ff5dcbb4c74743a1cc..bc5495f25a3b25f2b1829091220e292f9b73c66a 100644 (file)
@@ -17,6 +17,8 @@
 
 #include <vector>
 
+namespace llvm {
+
 template<class ConcreteTreeNode, class Payload>
 class Tree {
   std::vector<ConcreteTreeNode*> Children;        // This nodes children, if any
@@ -55,5 +57,6 @@ public:
   inline const Payload &getTreeData() const { return Data; }
 };
 
+} // End llvm namespace
 
 #endif
index aa2093a43db2c96361b74ce347a05138a0bccf86..5d9035076f3353842d3c56b2dacc8a49b14e5df8 100644 (file)
@@ -18,6 +18,8 @@
 
 #include <typeinfo>
 
+namespace llvm {
+
 struct TypeInfo {
   TypeInfo() {                     // needed for containers
     struct Nil {};  // Anonymous class distinct from all others...
@@ -69,4 +71,6 @@ inline bool operator>=(const TypeInfo &lhs, const TypeInfo &rhs) {
   return !(lhs < rhs);
 }
 
+} // End llvm namespace
+
 #endif
index 32778309d4eb3e229ed1a2f8bfa6e660cc36eb3b..cf7cf5d2ebb7ff410fd55f27a689934c41a19bda 100644 (file)
@@ -17,6 +17,8 @@
 
 #include <cstdarg>
 
+namespace llvm {
+
 /// make_vector - Helper function which is useful for building temporary vectors
 /// to pass into type construction of CallInst ctors.  This turns a null
 /// terminated list of pointers (or other value types) into a real live vector.
@@ -33,4 +35,6 @@ inline std::vector<T> make_vector(T A, ...) {
   return Result;
 }
 
+} // End llvm namespace
+
 #endif
index 488a90ffde02882637b7fe1230a84d37dc3f124a..7f4d2659d5f1ce4ade1bf8457758fdac4bdd0ece 100644 (file)
@@ -41,6 +41,8 @@
 #include <Support/iterator>
 #include <cassert>
 
+namespace llvm {
+
 template<typename NodeTy, typename Traits> class iplist;
 template<typename NodeTy> class ilist_iterator;
 
@@ -522,10 +524,12 @@ struct ilist : public iplist<NodeTy> {
   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(iplist<Ty> &Left, iplist<Ty> &Right) {
+  void swap(llvm::iplist<Ty> &Left, llvm::iplist<Ty> &Right) {
     Left.swap(Right);
   }
 }  // End 'std' extensions...
index 08bafa15806ae7a17e545167fcc6761c354dd7b0..72f55b38c4fb85b2d0328acf6360fdebc9ee1510 100644 (file)
@@ -30,6 +30,8 @@
 #include <functional>
 #include <iostream>
 
+namespace llvm {
+
 class BitSetVector {
   enum { BITSET_WORDSIZE = sizeof(long)*8 };
 
@@ -266,4 +268,5 @@ inline bool Disjoint(const BitSetVector& set1,
   return true;
 }
 
+} // End llvm namespace
 #endif
index bb7673c83d415872a59d4422e4b647652c756bb8..c465f4e549eb5df61b200bff2661ad1aaf6965f4 100644 (file)
@@ -38,6 +38,8 @@
 #include <vector>
 #include <set>
 
+namespace llvm {
+
 // df_iterator_storage - A private class which is used to figure out where to
 // store the visited set.
 template<class SetType, bool External>   // Non-external set
@@ -223,5 +225,6 @@ idf_ext_iterator<T, SetTy> idf_ext_end(T G, SetTy &S) {
   return idf_ext_iterator<T, SetTy>::end(G, S);
 }
 
+} // End llvm namespace
 
 #endif
index 01e8c5ef8209bd1d17916bde446724f3790f019f..46e626b69b585456001980dec42334d2662424a3 100644 (file)
@@ -20,6 +20,8 @@
 #include <map>
 #include <vector>
 
+namespace llvm {
+
 template <class ElemTy>
 class EquivalenceClasses {
   // Maps each element to the element that is the leader of its 
@@ -89,4 +91,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif
index 305f71e2800e470acfcb1abe7cb3b36fd8c7b321..4ff74176a7a5877679170c334d529c24f09cb264 100644 (file)
@@ -18,6 +18,8 @@
 #ifndef SUPPORT_GRAPHTRAITS_H
 #define SUPPORT_GRAPHTRAITS_H
 
+namespace llvm {
+
 // GraphTraits - This class should be specialized by different graph types...
 // which is why the default version is empty.
 //
@@ -76,4 +78,6 @@ struct Inverse {
   inline Inverse(GraphType &G) : Graph(G) {}
 };
 
+} // End llvm namespace
+
 #endif
index 9309554f3287fb5d884beaa807276f2d1a5f31fe..d66c4b84c40240467f9d2c1439f770d1d4c773d5 100644 (file)
@@ -21,6 +21,8 @@
 #include <stack>
 #include <set>
 
+namespace llvm {
+
 template<class GraphT, class GT = GraphTraits<GraphT> >
 class po_iterator : public forward_iterator<typename GT::NodeType, ptrdiff_t> {
   typedef forward_iterator<typename GT::NodeType, ptrdiff_t> super;
@@ -149,4 +151,6 @@ public:
   inline rpo_iterator end()   { return Blocks.rend(); }
 };
 
+} // End llvm namespace
+
 #endif
index cf137cd473404e91fdd1a750220dbaa1de73cdd8..f21c7d162e5129fa713ad291e21080acb30e8d81 100644 (file)
@@ -26,6 +26,8 @@
 #include <vector>
 #include <map>
 
+namespace llvm {
+
 //===----------------------------------------------------------------------===//
 ///
 /// scc_iterator - Enumerate the SCCs of a directed graph, in
@@ -197,4 +199,6 @@ scc_iterator<T> scc_end(T G) {
   return scc_iterator<T>::end(G);
 }
 
+} // End llvm namespace
+
 #endif
index 28c46e3d99a0e3fd4749fa22849f82bf67acb1f2..06a15734a7b0149963c88b77ba8a29993a99fb0e 100644 (file)
@@ -21,6 +21,8 @@
 #include "Support/iterator"
 #include "boost/type_traits/transform_traits.hpp"
 
+namespace llvm {
+
 //===----------------------------------------------------------------------===//
 //     Extra additions to <functional>
 //===----------------------------------------------------------------------===//
@@ -278,4 +280,6 @@ inline tier<T1, T2> tie(T1& f, T2& s) {
   return tier<T1, T2>(f, s);
 }
 
+} // End llvm namespace
+
 #endif
index dc6e0d6029efa6e75857ddd5c1d75fa570879697..bb1e68e6b299c9cf443831403e4d5e3e8b850012 100644 (file)
@@ -15,6 +15,8 @@
 #ifndef SUPPORT_SETOPERATIONS_H
 #define SUPPORT_SETOPERATIONS_H
 
+namespace llvm {
+
 // set_union(A, B) - Compute A := A u B, return whether A changed.
 //
 template <class S1Ty, class S2Ty>
@@ -64,4 +66,6 @@ void set_subtract(S1Ty &S1, const S2Ty &S2) {
     S1.erase(*SI);
 }
 
+} // End llvm namespace
+
 #endif
index d69809ff186e54f1c5f2701e1b44e9290664f9b7..4e592d5832f8cffb424a0186634362847dd31a6f 100644 (file)
@@ -26,6 +26,8 @@
 
 #include <iosfwd>
 
+namespace llvm {
+
 // StatisticBase - Nontemplated base class for Statistic<> class...
 class StatisticBase {
   const char *Name;
@@ -78,4 +80,6 @@ public:
   const Statistic &operator-=(const DataType &V) { Value -= V; return *this; }
 };
 
+} // End llvm namespace
+
 #endif
index 2c50c1cd5be39b821e816d608210f298c8fcef89..2ebac81935cae59777898199f119060f9df7ed17 100644 (file)
@@ -18,6 +18,8 @@
 #include <string>
 #include <stdio.h>
 
+namespace llvm {
+
 static inline std::string utohexstr(uint64_t X) {
   char Buffer[40];
   char *BufPtr = Buffer+39;
@@ -95,4 +97,6 @@ static inline std::string ftostr(double V) {
   return Buffer;
 }
 
+} // End llvm namespace
+
 #endif
index e6454317a8c9fd15cf36d5ff5dcbb4c74743a1cc..bc5495f25a3b25f2b1829091220e292f9b73c66a 100644 (file)
@@ -17,6 +17,8 @@
 
 #include <vector>
 
+namespace llvm {
+
 template<class ConcreteTreeNode, class Payload>
 class Tree {
   std::vector<ConcreteTreeNode*> Children;        // This nodes children, if any
@@ -55,5 +57,6 @@ public:
   inline const Payload &getTreeData() const { return Data; }
 };
 
+} // End llvm namespace
 
 #endif
index 32778309d4eb3e229ed1a2f8bfa6e660cc36eb3b..cf7cf5d2ebb7ff410fd55f27a689934c41a19bda 100644 (file)
@@ -17,6 +17,8 @@
 
 #include <cstdarg>
 
+namespace llvm {
+
 /// make_vector - Helper function which is useful for building temporary vectors
 /// to pass into type construction of CallInst ctors.  This turns a null
 /// terminated list of pointers (or other value types) into a real live vector.
@@ -33,4 +35,6 @@ inline std::vector<T> make_vector(T A, ...) {
   return Result;
 }
 
+} // End llvm namespace
+
 #endif
index 488a90ffde02882637b7fe1230a84d37dc3f124a..7f4d2659d5f1ce4ade1bf8457758fdac4bdd0ece 100644 (file)
@@ -41,6 +41,8 @@
 #include <Support/iterator>
 #include <cassert>
 
+namespace llvm {
+
 template<typename NodeTy, typename Traits> class iplist;
 template<typename NodeTy> class ilist_iterator;
 
@@ -522,10 +524,12 @@ struct ilist : public iplist<NodeTy> {
   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(iplist<Ty> &Left, iplist<Ty> &Right) {
+  void swap(llvm::iplist<Ty> &Left, llvm::iplist<Ty> &Right) {
     Left.swap(Right);
   }
 }  // End 'std' extensions...
index 9e3edddbc2235c16a14892413a0da3c8ed8777d8..8a18f5896c9cc786581b9441df7611567bbe023a 100644 (file)
@@ -37,6 +37,8 @@
 //
 #include <cassert>
 
+namespace llvm {
+
 class Type;
 class DerivedType;
 
@@ -165,4 +167,6 @@ private:
   void dropRef();
 };
 
+} // End llvm namespace
+
 #endif
index 4ce3f4baf17ad4d3e1f9ea8aafa5b6db3aa1bffd..dc484f5df57ed03d3b484908ccabd57e330b5290 100644 (file)
@@ -31,6 +31,9 @@
 #define LLVM_ANALYSIS_ALIAS_ANALYSIS_H
 
 #include "llvm/Support/CallSite.h"
+
+namespace llvm {
+
 class LoadInst;
 class StoreInst;
 class TargetData;
@@ -156,4 +159,6 @@ public:
                                  const Value *Ptr, unsigned Size);
 };
 
+} // End llvm namespace
+
 #endif
index 72168b47561ffe938bd09d85a3071cdb3bd84214..fe57c28679d8038f88969cfa748ba57e53bdd42b 100644 (file)
@@ -21,6 +21,9 @@
 #include "Support/iterator"
 #include "Support/hash_map"
 #include "Support/ilist"
+
+namespace llvm {
+
 class AliasAnalysis;
 class LoadInst;
 class StoreInst;
@@ -283,4 +286,6 @@ inline std::ostream& operator<<(std::ostream &OS, const AliasSetTracker &AST) {
   return OS;
 }
 
+} // End llvm namespace
+
 #endif
index 3a51b05655075f8bbfe921da7e882fa7b6f2caf0..60649f9ed9d2ae97b151a03bdf949dc755e2eb7e 100644 (file)
@@ -51,6 +51,9 @@
 #include "Support/GraphTraits.h"
 #include "Support/STLExtras.h"
 #include "llvm/Pass.h"
+
+namespace llvm {
+
 class Function;
 class Module;
 class CallGraphNode;
@@ -288,4 +291,6 @@ template<> struct GraphTraits<const CallGraph*> :
 static IncludeFile
 CALLGRAPH_INCLUDE_FILE((void*)&CallGraph::stub);
 
+} // End llvm namespace
+
 #endif
index c7efd76cef99cccec99ddb24b0a63f91cab4cc3f..e1533c35bb0c6efc141131b34d6f6f17010f3e8b 100644 (file)
@@ -19,6 +19,9 @@
 #include "llvm/Support/InstIterator.h"
 #include "llvm/Instruction.h"
 #include "Support/iterator"
+
+namespace llvm {
+
 class Constant;
 
 class constant_iterator : public forward_iterator<const Constant, ptrdiff_t> {
@@ -86,4 +89,6 @@ inline constant_iterator constant_end(const Function *F) {
   return constant_iterator(F, true);
 }
 
+} // End llvm namespace
+
 #endif
index 399da007e240a7d21112c46629b906e2708717c7..b7fdb10af50e9449cc1efb67d4852e68f9468130 100644 (file)
@@ -15,6 +15,9 @@
 #define LLVM_ANALYSIS_DSGRAPH_H
 
 #include "llvm/Analysis/DSNode.h"
+
+namespace llvm {
+
 class GlobalValue;
 
 //===----------------------------------------------------------------------===//
@@ -332,4 +335,6 @@ public:
   void removeTriviallyDeadNodes();
 };
 
+} // End llvm namespace
+
 #endif
index 086835cb92a8096264355fdd397dffefcc689c9c..ad2cc6fa8f4ef1b1ce181aa98c8c21bf8c0daf37 100644 (file)
@@ -21,6 +21,8 @@
 #include "Support/iterator"
 #include "Support/STLExtras.h"
 
+namespace llvm {
+
 template<typename NodeTy>
 class DSNodeIterator : public forward_iterator<const DSNode, ptrdiff_t> {
   friend class DSNode;
@@ -146,4 +148,6 @@ template <> struct GraphTraits<const DSGraph*> {
   static ChildIteratorType child_end(const NodeType *N) { return N->end(); }
 };
 
+} // End llvm namespace
+
 #endif
index ba5328b2b8f7e4c0fc42ad1dde48c808592847d2..f206c3e5ada68198cb49fc798db0557bb2ea41c5 100644 (file)
@@ -16,6 +16,8 @@
 
 #include "llvm/Analysis/DSSupport.h"
 
+namespace llvm {
+
 template<typename BaseType>
 class DSNodeIterator;          // Data structure graph traversal iterator
 class TargetData;
@@ -382,4 +384,6 @@ inline void DSNodeHandle::mergeWith(const DSNodeHandle &Node) {
     *this = Node;
 }
 
+} // End llvm namespace
+
 #endif
index e5662ff0a4cb2d7506c24dd4ec7683f482124ce8..4b571917ff35a2b1ddc6d8e02881171de97de649 100644 (file)
@@ -18,6 +18,8 @@
 #include "Support/hash_set"
 #include "llvm/Support/CallSite.h"
 
+namespace llvm {
+
 class Function;
 class CallInst;
 class Value;
@@ -122,10 +124,14 @@ private:
   DSNode *HandleForwarding() const;
 };
 
+} // End llvm namespace
+
 namespace std {
-  inline void swap(DSNodeHandle &NH1, DSNodeHandle &NH2) { NH1.swap(NH2); }
+  inline void swap(llvm::DSNodeHandle &NH1, llvm::DSNodeHandle &NH2) { NH1.swap(NH2); }
 }
 
+namespace llvm {
+
 //===----------------------------------------------------------------------===//
 /// DSCallSite - Representation of a call site via its call instruction,
 /// the DSNode handle for the callee function (or function pointer), and
@@ -287,7 +293,9 @@ public:
   }
 };
 
+} // End llvm namespace
+
 namespace std {
-  inline void swap(DSCallSite &CS1, DSCallSite &CS2) { CS1.swap(CS2); }
+  inline void swap(llvm::DSCallSite &CS1, llvm::DSCallSite &CS2) { CS1.swap(CS2); }
 }
 #endif
index afea126c074dbb14f34a642cffa519f68e448ea5..4d6e3a047604326976721f2fc754ebdbb6cc4510 100644 (file)
@@ -18,6 +18,8 @@
 #include "llvm/Target/TargetData.h"
 #include "Support/hash_set"
 
+namespace llvm {
+
 class Type;
 class Instruction;
 class DSGraph;
@@ -184,4 +186,6 @@ private:
                         const BUDataStructures::ActualCalleesTy &ActualCallees);
 };
 
+} // End llvm namespace
+
 #endif
index 399da007e240a7d21112c46629b906e2708717c7..b7fdb10af50e9449cc1efb67d4852e68f9468130 100644 (file)
@@ -15,6 +15,9 @@
 #define LLVM_ANALYSIS_DSGRAPH_H
 
 #include "llvm/Analysis/DSNode.h"
+
+namespace llvm {
+
 class GlobalValue;
 
 //===----------------------------------------------------------------------===//
@@ -332,4 +335,6 @@ public:
   void removeTriviallyDeadNodes();
 };
 
+} // End llvm namespace
+
 #endif
index 086835cb92a8096264355fdd397dffefcc689c9c..ad2cc6fa8f4ef1b1ce181aa98c8c21bf8c0daf37 100644 (file)
@@ -21,6 +21,8 @@
 #include "Support/iterator"
 #include "Support/STLExtras.h"
 
+namespace llvm {
+
 template<typename NodeTy>
 class DSNodeIterator : public forward_iterator<const DSNode, ptrdiff_t> {
   friend class DSNode;
@@ -146,4 +148,6 @@ template <> struct GraphTraits<const DSGraph*> {
   static ChildIteratorType child_end(const NodeType *N) { return N->end(); }
 };
 
+} // End llvm namespace
+
 #endif
index ba5328b2b8f7e4c0fc42ad1dde48c808592847d2..f206c3e5ada68198cb49fc798db0557bb2ea41c5 100644 (file)
@@ -16,6 +16,8 @@
 
 #include "llvm/Analysis/DSSupport.h"
 
+namespace llvm {
+
 template<typename BaseType>
 class DSNodeIterator;          // Data structure graph traversal iterator
 class TargetData;
@@ -382,4 +384,6 @@ inline void DSNodeHandle::mergeWith(const DSNodeHandle &Node) {
     *this = Node;
 }
 
+} // End llvm namespace
+
 #endif
index e5662ff0a4cb2d7506c24dd4ec7683f482124ce8..4b571917ff35a2b1ddc6d8e02881171de97de649 100644 (file)
@@ -18,6 +18,8 @@
 #include "Support/hash_set"
 #include "llvm/Support/CallSite.h"
 
+namespace llvm {
+
 class Function;
 class CallInst;
 class Value;
@@ -122,10 +124,14 @@ private:
   DSNode *HandleForwarding() const;
 };
 
+} // End llvm namespace
+
 namespace std {
-  inline void swap(DSNodeHandle &NH1, DSNodeHandle &NH2) { NH1.swap(NH2); }
+  inline void swap(llvm::DSNodeHandle &NH1, llvm::DSNodeHandle &NH2) { NH1.swap(NH2); }
 }
 
+namespace llvm {
+
 //===----------------------------------------------------------------------===//
 /// DSCallSite - Representation of a call site via its call instruction,
 /// the DSNode handle for the callee function (or function pointer), and
@@ -287,7 +293,9 @@ public:
   }
 };
 
+} // End llvm namespace
+
 namespace std {
-  inline void swap(DSCallSite &CS1, DSCallSite &CS2) { CS1.swap(CS2); }
+  inline void swap(llvm::DSCallSite &CS1, llvm::DSCallSite &CS2) { CS1.swap(CS2); }
 }
 #endif
index afea126c074dbb14f34a642cffa519f68e448ea5..4d6e3a047604326976721f2fc754ebdbb6cc4510 100644 (file)
@@ -18,6 +18,8 @@
 #include "llvm/Target/TargetData.h"
 #include "Support/hash_set"
 
+namespace llvm {
+
 class Type;
 class Instruction;
 class DSGraph;
@@ -184,4 +186,6 @@ private:
                         const BUDataStructures::ActualCalleesTy &ActualCallees);
 };
 
+} // End llvm namespace
+
 #endif
index b5af0b9e254e7c643cca8fd730dc8c4a1b88642a..b4c7aa1fcc598bf9b671a2e9a1d796356ead969e 100644 (file)
@@ -30,6 +30,8 @@
 #include <utility>
 #include <cassert>
 
+namespace llvm {
+
 class Instruction;
 class Function;
 class Dependence;
@@ -264,4 +266,6 @@ public:
 
 //===----------------------------------------------------------------------===//
 
+} // End llvm namespace
+
 #endif
index b8ac9c3e11efdac9263373a1952a9f9b340d8b92..5688d6e8119976a5eea122a46c7a838e5af32729 100644 (file)
@@ -28,6 +28,8 @@
 #include "llvm/Pass.h"
 #include <set>
 
+namespace llvm {
+
 class Instruction;
 
 template <typename GraphType> struct GraphTraits;
@@ -487,4 +489,6 @@ private:
                               const DominatorTree::Node *Node);
 };
 
+} // End llvm namespace
+
 #endif
index 29207618d167a2e60dac5565e2c931ced2266090..77475ffa6c135634269668481b32c67e0ceabb1c 100644 (file)
@@ -17,6 +17,8 @@
 #ifndef LLVM_ANALYSIS_EXPRESSIONS_H
 #define LLVM_ANALYSIS_EXPRESSIONS_H
 
+namespace llvm {
+
 class Type;
 class Value;
 class ConstantInt;
@@ -56,4 +58,6 @@ struct ExprType {
   const Type *getExprType(const Type *Default) const;
 };
 
+} // End llvm namespace
+
 #endif
index 8f1cdcf0940de33e8a3819e1fcd335111ccda05a..62077f37d57ceaa17ee5452a06e06cc1ce3cc756 100644 (file)
@@ -27,6 +27,8 @@
 #include "llvm/Pass.h"
 #include <set>
 
+namespace llvm {
+
 class PointerType;
 
 struct FindUnsafePointerTypes : public Pass {
@@ -55,4 +57,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif
index a246084dbb405ee23ea6e73dd87130c515d374a8..69471791ab04738f8de6ddd9a394f6f8e07a51a8 100644 (file)
@@ -16,6 +16,9 @@
 
 #include "llvm/Pass.h"
 #include <set>
+
+namespace llvm {
+
 class Type;
 
 class FindUsedTypes : public Pass {
@@ -59,4 +62,6 @@ public:
 static IncludeFile
 FIND_USED_TYPES_INCLUDE_FILE((void*)&FindUsedTypes::stub);
 
+} // End llvm namespace
+
 #endif
index 84e55195e5918d1ef54a772142c33a7626e43aa4..cf70d5835ebf9681699e1e5f96bfd68b0f2cd24f 100644 (file)
@@ -50,6 +50,8 @@
 #include "Support/BitSetVector.h"
 #include "Support/hash_map"
 
+namespace llvm {
+
 class Module;
 class Function;
 class CallSite;
@@ -239,4 +241,6 @@ public:
 
 //===----------------------------------------------------------------------===//
 
+} // End llvm namespace
+
 #endif
index 26deb832f80770098ce14397cf6c8f8a98f8a3c1..6c06a6c065c9fa67f0217627cf74013eb733c48b 100644 (file)
@@ -27,6 +27,9 @@
 #define LLVM_ANALYSIS_INDUCTIONVARIABLE_H
 
 #include <iosfwd>
+
+namespace llvm {
+
 class Value;
 class PHINode;
 class Instruction;
@@ -60,4 +63,6 @@ public:
   void print(std::ostream &OS) const;
 };
 
+} // End llvm namespace
+
 #endif
index a034c92d51ccd7313731eee0475ddf7f7cc5a3da..82fc46e1d1745b85027f97fa16a14fb03ecba9e0 100644 (file)
@@ -25,6 +25,8 @@
 #include "Support/Tree.h"
 #include <map>
 
+namespace llvm {
+
 template<class Payload> class InstTreeNode;
 template<class Payload> class InstForest;
 
@@ -288,5 +290,7 @@ InstTreeNode<Payload>::InstTreeNode(InstForest<Payload> &IF, Value *V,
   getTreeData().first.second = InstructionNode;
 }
 
+} // End llvm namespace
+
 #endif
 
index 9839cf5dc08f6ac80edc810df8df9e36b3697aaa..0d5912305bc57ee8296ea6e8f9d0b424c2b3ada9 100644 (file)
@@ -24,6 +24,8 @@
 #include <vector>
 #include <iosfwd>
 
+namespace llvm {
+
 class BasicBlock;
 
 //===----------------------------------------------------------------------===//
@@ -146,4 +148,6 @@ template <> struct GraphTraits<Inverse<Interval*> > {
   }
 };
 
+} // End llvm namespace
+
 #endif
index 2d67ded1962d79842d35d35b75017add24e7b1cf..091959f25fa0e43915e1f53e394281597f5649da 100644 (file)
@@ -40,6 +40,8 @@
 #include <set>
 #include <algorithm>
 
+namespace llvm {
+
 // getNodeHeader - Given a source graph node and the source graph, return the 
 // BasicBlock that is the header node.  This is the opposite of
 // getSourceGraphNode.
@@ -253,4 +255,6 @@ inline interval_part_interval_iterator intervals_end(IntervalPartition &IP) {
   return interval_part_interval_iterator();
 }
 
+} // End llvm namespace
+
 #endif
index 45e282acdfd5b8f2dc72abbd1588a2bfa830848c..408ace2e7ef47f771ba2e356ec5f7fa407276432 100644 (file)
@@ -26,6 +26,8 @@
 #include "llvm/Analysis/Interval.h"
 #include "llvm/Pass.h"
 
+namespace llvm {
+
 //===----------------------------------------------------------------------===//
 //
 // IntervalPartition - This class builds and holds an "interval partition" for
@@ -102,4 +104,6 @@ private:
   void updatePredecessors(Interval *Int);
 };
 
+} // End llvm namespace
+
 #endif
index 83aa5e99a605fb289d1805f15044a3ecada694c4..6218133a51343cb3d831c17e3c395d0d25efb772 100644 (file)
@@ -21,6 +21,8 @@
 #ifndef LLVM_ANALYSIS_LOAD_VALUE_NUMBERING_H
 #define LLVM_ANALYSIS_LOAD_VALUE_NUMBERING_H
 
+namespace llvm {
+
 class Pass;
 
 /// createLoadValueNumberingPass - Create and return a new pass that implements
@@ -28,4 +30,6 @@ class Pass;
 ///
 Pass *createLoadValueNumberingPass();
 
+} // End llvm namespace
+
 #endif
index 6a96834a1581caa66af6c5e36b1a5ce006fbc97c..1458b3bd5f68de57166063fbb83e0c6ee3ad4334 100644 (file)
@@ -29,6 +29,8 @@
 #include "Support/GraphTraits.h"
 #include <set>
 
+namespace llvm {
+
 class DominatorSet;
 class LoopInfo;
 
@@ -224,4 +226,6 @@ template <> struct GraphTraits<Loop*> {
   }
 };
 
+} // End llvm namespace
+
 #endif
index 6ecc3c825076b203cb453a92018d943703838350..10eb6566b67f345a1202dbfd2e00bf932cafd8d8 100644 (file)
@@ -24,6 +24,8 @@
 #include "llvm/Pass.h"
 #include "Support/hash_map"
 
+namespace llvm {
+
 class ModRefTable;
 class DSGraph;
 class FunctionModRefInfo;
@@ -96,4 +98,6 @@ public:
   void dump() const;
 };
 
+} // End llvm namespace
+
 #endif
index edb5119f00d6933419fd4c5883cee2c134b1987a..70128740a83f735b32d6a95f760b219a2539ea1b 100644 (file)
@@ -46,6 +46,8 @@
 #include "llvm/Pass.h"
 #include "Support/iterator"
 
+namespace llvm {
+
 class DSGraph;
 class DependenceGraph;
 class PgmDependenceGraph;
@@ -304,7 +306,8 @@ public:
   void dump() const;
 };
 
-
 //===----------------------------------------------------------------------===//
 
+} // End llvm namespace
+
 #endif
index b1a9b8ed1687b63c0609e869d7dd7f442e6417e2..c8eb439b41ae627fa233ff9822d9606789290cb8 100644 (file)
@@ -16,6 +16,8 @@
 
 #include "llvm/Analysis/Dominators.h"
 
+namespace llvm {
+
 
 /// PostDominatorSet Class - Concrete subclass of DominatorSetBase that is used
 /// to compute the post-dominator set.  Because there can be multiple exit nodes
@@ -117,4 +119,6 @@ private:
 static IncludeFile
 POST_DOMINATOR_INCLUDE_FILE((void*)&PostDominanceFrontier::stub);
 
+} // End llvm namespace
+
 #endif
index 7e56de99dca72207fa1b2f60e6117cd6e8ac0c61..596f9324edbae88012850f7b3f8444b6766d3701 100644 (file)
@@ -22,6 +22,9 @@
 
 #include <vector>
 #include <map>
+
+namespace llvm {
+
 class Value;
 class Module;
 class Function;
@@ -92,4 +95,6 @@ protected:
   void processSymbolTableConstants(const SymbolTable *ST);
 };
 
+} // End llvm namespace
+
 #endif
index ff4680d663c203d001ed8ad9ed43b878051b0f2f..74b5c97ff2333e963a693d8033e548e64417d833 100644 (file)
@@ -21,6 +21,9 @@
 #define LLVM_ANALYSIS_VALUE_NUMBERING_H
 
 #include <vector>
+
+namespace llvm {
+
 class Value;
 
 struct ValueNumbering {
@@ -34,4 +37,6 @@ struct ValueNumbering {
   virtual ~ValueNumbering();    // We want to be subclassed
 };
 
+} // End llvm namespace
+
 #endif
index 427015c6c6456561b0255a04d490d5985ad334a3..51da3a5eae4085410918e42a63c02f041920aad5 100644 (file)
@@ -21,6 +21,8 @@
 #ifndef LLVM_ANALYSIS_VERIFIER_H
 #define LLVM_ANALYSIS_VERIFIER_H
 
+namespace llvm {
+
 class FunctionPass;
 class Module;
 class Function;
@@ -40,4 +42,6 @@ bool verifyModule(const Module &M);
 // pass.
 bool verifyFunction(const Function &F);
 
+} // End llvm namespace
+
 #endif
index 2d70f5314b23b2d1e252162cfc658c20cba80be0..ab4ee1bf0eba8f3f02b97d9ec22537c78a4f654e 100644 (file)
@@ -17,6 +17,8 @@
 
 #include "llvm/Value.h"
 
+namespace llvm {
+
 class Argument : public Value {  // Defined in the Function.cpp file
   Function *Parent;
 
@@ -56,4 +58,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif
index 192cb3de0b2f7f3f0ca9cab29722784168815a73..3beda6df03d1fe46416f28665935645af289e145 100644 (file)
@@ -18,6 +18,9 @@
 #define LLVM_ASSEMBLY_ASMANNOTATIONWRITER_H
 
 #include <iosfwd>
+
+namespace llvm {
+
 class Function;
 class BasicBlock;
 class Instruction;
@@ -37,4 +40,6 @@ struct AssemblyAnnotationWriter {
   virtual void emitInstructionAnnot(const Instruction *I, std::ostream &OS) {}
 };
 
+} // End llvm namespace
+
 #endif
index cc7a358a9b30c18acb6518c8ca861162d6280024..3029787ca4533a2de451c3af2ffb9a701c25fa4b 100644 (file)
 #define LLVM_ASSEMBLY_CWRITER_H
 
 #include <iosfwd>
+
+namespace llvm {
+
 class Pass;
 Pass *createWriteToCPass(std::ostream &o);
 
+} // End llvm namespace
+
 #endif
index dbddacde9319664d8cb6722817e69614e781bec1..4acd3de4da9c1488d90174eca734896223bd2bba 100644 (file)
@@ -20,6 +20,8 @@
 #include "llvm/Value.h"
 #include <iostream>
 
+namespace llvm {
+
 class Module;
 class PointerType;
 class SlotCalculator;
@@ -82,4 +84,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif
index 4f1863f0717ecb7dc05dc16fa8a41d48007058ec..dc1b17eb50b98e6b34f084b013fec0b42fcf3225 100644 (file)
@@ -16,6 +16,8 @@
 
 #include <string>
 
+namespace llvm {
+
 class Module;
 class ParseException;
 
@@ -70,4 +72,6 @@ private :
   ParseException &operator=(const ParseException &E); // objects by reference
 };
 
+} // End llvm namespace
+
 #endif
index e211e8bdae62a065e0180bb2ea081bad4fd7dbe2..28100805a7b3bb89a41043b82d17cb0775409f51 100644 (file)
@@ -21,6 +21,8 @@
 #include "llvm/Pass.h"
 #include "llvm/Module.h"
 
+namespace llvm {
+
 class PrintModulePass : public Pass {
   std::ostream *Out;      // ostream to print on
   bool DeleteStream;      // Delete the ostream in our dtor?
@@ -72,4 +74,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif
index 5798ae8ac78628610ec9164141f22056e4feacd7..9f89b3192fd16f189a93f5c3d67e962efa2ba9cd 100644 (file)
@@ -24,6 +24,9 @@
 #define LLVM_ASSEMBLY_WRITER_H
 
 #include <iosfwd>
+
+namespace llvm {
+
 class Type;
 class Module;
 class Value;
@@ -43,4 +46,6 @@ std::ostream &WriteTypeSymbolic(std::ostream &, const Type *, const Module *M);
 std::ostream &WriteAsOperand(std::ostream &, const Value *, bool PrintTy = true,
                              bool PrintName = true, const Module *Context = 0);
 
+} // End llvm namespace
+
 #endif
index 1a996bcf265ee597fed78f06f9b672eafdf10401..9f78bc7467bd029a7ae6ac285500b91d60c5d16f 100644 (file)
@@ -33,6 +33,8 @@
 #include "llvm/SymbolTableListTraits.h"
 #include "Support/ilist"
 
+namespace llvm {
+
 class TerminatorInst;
 template <class _Term, class _BB> class SuccIterator;  // Successor Iterator
 template <class _Ptr, class _USE_iterator> class PredIterator;
@@ -171,4 +173,6 @@ public:
   BasicBlock *splitBasicBlock(iterator I, const std::string &BBName = "");
 };
 
+} // End llvm namespace
+
 #endif
index 79cf9f0527ac0124b89ebff9d5e36ea665cf610c..380f4df0ab44f2affd4d19e0227bafbbdf4cbd18 100644 (file)
@@ -15,6 +15,8 @@
 #ifndef LLVM_BYTECODE_FORMAT_H
 #define LLVM_BYTECODE_FORMAT_H
 
+namespace llvm {
+
 class BytecodeFormat {   // Throw the constants into a poorman's namespace...
   BytecodeFormat();      // do not implement
 public:
@@ -38,4 +40,7 @@ public:
     BasicBlock = 0x31,        // May contain many basic blocks
   };
 };
+
+} // End llvm namespace
+
 #endif
index d9b29c00e78073c4b526e79155e4ddeb42621539..3973eceadb89328a3fb52bb018af3b92f5036994 100644 (file)
@@ -23,6 +23,8 @@
 #include <string>
 #include <deque>
 
+namespace llvm {
+
 //===----------------------------------------------------------------------===//
 //                             Reading Primitives
 //===----------------------------------------------------------------------===//
@@ -275,4 +277,6 @@ static inline void output_data(void *Ptr, void *End,
   if (Align) align32(Out);
 }
 
+} // End llvm namespace
+
 #endif
index 0de71002a7c83b46dc1f20b7bfeb8d91e3941cb4..1e9fa32bd12309743c17b313502e4dc30d92958b 100644 (file)
@@ -23,6 +23,8 @@
 #include <string>
 #include <vector>
 
+namespace llvm {
+
 /// getBytecodeModuleProvider - lazy function-at-a-time loading from a file
 ///
 ModuleProvider *getBytecodeModuleProvider(const std::string &Filename);
@@ -53,4 +55,6 @@ bool ReadArchiveFile(const std::string &Filename,
                      std::vector<Module*> &Objects,
                      std::string *ErrorStr = 0);
 
+} // End llvm namespace
+
 #endif
index ba8bc71c4c59a094c0d67d52ff5928222a57da54..b8863e6b476cc300312f47e732230d52ba89e045 100644 (file)
@@ -19,6 +19,8 @@
 #include "llvm/Bytecode/Writer.h"
 #include <iostream>
 
+namespace llvm {
+
 class WriteBytecodePass : public Pass {
   std::ostream *Out;           // ostream to print on
   bool DeleteStream;
@@ -38,4 +40,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif
index ba82f6ad192d126dfc48690f064124c796a44d19..9fadddb66b6130aa26ea2881b52d116e2ac8fc72 100644 (file)
 
 #include <iosfwd>
 
+namespace llvm {
+
 class Module;
 void WriteBytecodeToFile(const Module *C, std::ostream &Out);
 
+} // End llvm namespace
+
 #endif
index bb97a277cc91e98dbf2a367bb2226c60d17e15e1..86cdc29f571a580615a0dd5e6fa4c2cb95585100 100644 (file)
@@ -23,6 +23,8 @@
 
 #include "llvm/Pass.h"
 
+namespace llvm {
+
 class CallGraphNode;
 
 struct CallGraphSCCPass : public Pass {
@@ -46,4 +48,6 @@ struct CallGraphSCCPass : public Pass {
   virtual void getAnalysisUsage(AnalysisUsage &Info) const;
 };
 
+} // End llvm namespace
+
 #endif
index e79d58f7e4c2ea474a8637a4e29ae5badeb25916..23a9d93a6eb76fadd226a61290dc1c341c2b78fa 100644 (file)
@@ -39,6 +39,8 @@
 #include "llvm/Pass.h"
 #include "llvm/CodeGen/ValueSet.h"
 
+namespace llvm {
+
 class BBLiveVar;
 class MachineInstr;
 
@@ -104,4 +106,6 @@ public:
                                           const BasicBlock *BB = 0);
 };
 
+} // End llvm namespace
+
 #endif
index fc82d7c1659a8bcf1d7069f9984baae3a0915d7f..48266715bd11a67bdf893c5bd72547c710e3477d 100644 (file)
 #include "llvm/Instruction.h"
 #include "Support/hash_map"
 
+namespace llvm {
+
 class Constant;
 class Function;
 class InstrTreeNode;
 class InstrForest;
 
+} // End llvm namespace
+
+using namespace llvm;
+
 //--------------------------------------------------------------------------
 // OpLabel values for special-case nodes created for instruction selection.
 // All op-labels not defined here are identical to the instruction
 // opcode returned by Instruction::getOpcode()
 //--------------------------------------------------------------------------
+//
+
 
 const int  InvalidOp   =  -1;
 const int  VRegListOp   =  97;
@@ -103,6 +111,7 @@ extern void         printtree       (InstrTreeNode*);
 extern int             treecost        (InstrTreeNode*, int, int);
 extern void            printMatches    (InstrTreeNode*);
 
+namespace llvm {
 
 //------------------------------------------------------------------------ 
 // class InstrTreeNode
@@ -325,4 +334,6 @@ private:
   InstructionNode* buildTreeForInstruction(Instruction* instr);
 };
 
+} // End llvm namespace
+
 #endif
index 40ce442f552fa52025a3a8b7d5c7f88b926f0fe4..816aa7e806e32efe7c496bca024f0c5521a82db7 100644 (file)
@@ -15,6 +15,8 @@
 #ifndef LLVM_CODEGEN_INSTR_SCHEDULING_H
 #define LLVM_CODEGEN_INSTR_SCHEDULING_H
 
+namespace llvm {
+
 class FunctionPass;
 class TargetMachine;
 
@@ -30,4 +32,6 @@ class TargetMachine;
 
 FunctionPass *createInstructionSchedulingWithSSAPass(const TargetMachine &TM);
 
+} // End llvm namespace
+
 #endif
index 89e827d106b3d22669ac7d9d0afbbe44d3675c7a..2f269ea2d53aa4a1e0bf064c68c4a7bea7df3c28 100644 (file)
@@ -16,6 +16,8 @@
 
 #include "llvm/Instruction.h"
 
+namespace llvm {
+
 class Function;
 class InstrForest;
 class MachineInstr;
@@ -102,4 +104,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif
index 2ab23c756c8d5ffb7bd0ea1135bdd78f8172d60b..c1fba48615680eaa0344df6fe075d3ee9e5b3d64 100644 (file)
@@ -17,6 +17,9 @@
 
 #include "llvm/CodeGen/MachineInstr.h"
 #include "Support/DataTypes.h"
+
+namespace llvm {
+
 class InstructionNode;
 class TargetMachine;
 class Instruction;
@@ -44,4 +47,6 @@ MachineOperand::MachineOperandType ChooseRegOrImmed(int64_t intValue,
                                          unsigned& getMachineRegNum,
                                          int64_t& getImmedValue);
 
+} // End llvm namespace
+
 #endif
index 8d1306e061a42191b07a5d4c9f7e85fb1903fb20..3a0d044c59c29d5a47fabc2d2123c2e5ea1f21a8 100644 (file)
@@ -32,6 +32,8 @@
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include <map>
 
+namespace llvm {
+
 class MRegisterInfo;
 
 class LiveVariables : public MachineFunctionPass {
@@ -207,4 +209,6 @@ public:
   void HandlePhysRegDef(unsigned Reg, MachineInstr *MI);
 };
 
+} // End llvm namespace
+
 #endif
index b3959e81a71cf7906bd52c8e3210f4c18d32be31..b8a0361f7f35f29e29e18ec2f9a2e772672b986b 100644 (file)
@@ -15,6 +15,9 @@
 #define LLVM_CODEGEN_MACHINEBASICBLOCK_H
 
 #include <vector>
+
+namespace llvm {
+
 class BasicBlock;
 class MachineInstr;
 template <typename T> struct ilist_traits;
@@ -81,5 +84,6 @@ private:   // Methods used to maintain doubly linked list of blocks...
   void setNext(MachineBasicBlock *N) { Next = N; }
 };
 
+} // End llvm namespace
 
 #endif
index 4145851006569e046102c048da28860026623fc4..2d01f45d70242d3e2f46448afb941c35f997e4af 100644 (file)
@@ -19,6 +19,9 @@
 
 #include <string>
 #include "Support/DataTypes.h"
+
+namespace llvm {
+
 class MachineFunction;
 class MachineBasicBlock;
 class MachineConstantPool;
@@ -105,4 +108,6 @@ struct MachineCodeEmitter {
   static MachineCodeEmitter *createFilePrinterEmitter(MachineCodeEmitter&);
 };
 
+} // End llvm namespace
+
 #endif
index d421f3e971a72e727f7d09b1d7d06bd2a8d85236..9a08de79afab9ac6308706a60a969c07caf5b132 100644 (file)
@@ -28,6 +28,8 @@
 #include "Support/Annotation.h"
 #include <vector>
 
+namespace llvm {
+
 class MachineInstr;
 class Instruction;
 class Value;
@@ -96,4 +98,6 @@ public:
   CallArgsDescriptor* getCallArgsDescriptor() const    { return callArgsDesc; }
 };
 
+} // End llvm namespace
+
 #endif
index 441a43a9b9400b331d0cabc6254846f730d2c7ff..edfd601faa1ec2b2d0523c6d79e87fd487e5cc9e 100644 (file)
@@ -23,6 +23,9 @@
 #define LLVM_CODEGEN_MACHINECONSTANTPOOL_H
 
 #include <vector>
+
+namespace llvm {
+
 class Constant;
 
 class MachineConstantPool {
@@ -54,4 +57,6 @@ public:
   void dump() const;
 };
 
+} // End llvm namespace
+
 #endif
index 48b91012e0f81b68da6117aac13bee3b60288b14..e48158e1b5c9fb75dbd2109c09794ed85e69e41c 100644 (file)
 #ifndef LLVM_CODEGEN_MACHINEFRAMEINFO_H
 #define LLVM_CODEGEN_MACHINEFRAMEINFO_H
 
+namespace llvm {
+
 class TargetData;
 class TargetRegisterClass;
 class Type;
 class MachineFunction;
+
+}
+
 #include <vector>
 
+namespace llvm {
+
 class MachineFrameInfo {
 
   // StackObject - Represent a single object allocated on the stack.
@@ -220,4 +227,6 @@ public:
   void dump(const MachineFunction &MF) const;
 };
 
+} // End llvm namespace
+
 #endif
index 7474a6e29aa973bfead774b12266e02e02c6a176..60478cfe5a62166b47061e9f367d8bd4dd296e2a 100644 (file)
@@ -22,6 +22,8 @@
 #include "Support/Annotation.h"
 #include "Support/ilist"
 
+namespace llvm {
+
 class Function;
 class TargetMachine;
 class FunctionPass;
@@ -141,4 +143,6 @@ public:
         MachineBasicBlock & back()       { return BasicBlocks.back(); }
 };
 
+} // End llvm namespace
+
 #endif
index db7332227862b3a42f0de908a9ca126048bcf747..fdf135b16bb0ccc76fe54c0ac8a57a3b45fb0dc7 100644 (file)
@@ -17,6 +17,9 @@
 
 #include "Support/HashExtras.h"
 #include "Support/hash_set"
+
+namespace llvm {
+
 class MachineFunction;
 class Value;
 class Constant;
@@ -112,4 +115,6 @@ private:
   int allocateOptionalArg(const Type* type);
 };
 
+} // End llvm namespace
+
 #endif
index 6975b5e785652f97d02a99f766755ce34a1712b7..390dcb8562566b7bc6fb62f93bb0dc69855d22aa 100644 (file)
@@ -22,6 +22,8 @@
 #include "llvm/Pass.h"
 #include "llvm/CodeGen/MachineFunction.h"
 
+namespace llvm {
+
 struct MachineFunctionPass : public FunctionPass {
 
   /// runOnMachineFunction - This method must be overloaded to perform the
@@ -37,4 +39,6 @@ struct MachineFunctionPass : public FunctionPass {
   }
 };
 
+} // End llvm namespace
+
 #endif
index fc886d97f54830e7919067e89d2ea8bb013069f0..2eb373f46222fbe8cef60588d4de8d38444d9430 100644 (file)
@@ -20,6 +20,8 @@
 #include "Support/Annotation.h"
 #include "Support/iterator"
 
+namespace llvm {
+
 class Value;
 class Function;
 class MachineBasicBlock;
@@ -715,4 +717,6 @@ std::ostream& operator<<(std::ostream &OS, const MachineInstr &MI);
 std::ostream& operator<<(std::ostream &OS, const MachineOperand &MO);
 void PrintMachineInstructions(const Function *F);
 
+} // End llvm namespace
+
 #endif
index 98dde590b8d01d6417d46b90eafbf4da9e740235..19d93ab56ad3e70c8c492be9e7efabad27514133 100644 (file)
@@ -17,6 +17,8 @@
 #include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/Target/TargetRegInfo.h"
 
+namespace llvm {
+
 class Value;
 class TmpInstruction;
 class CallInst;
@@ -88,5 +90,6 @@ public:
   static CallArgsDescriptor *get(const MachineInstr* MI);
 };
 
+} // End llvm namespace
 
 #endif
index 14c7fe041fd038cda79a3b6b013bbc783c1f927b..67255214a20b0f3db00e5a9172226552035ced85 100644 (file)
@@ -25,6 +25,8 @@
 
 #include "llvm/CodeGen/MachineInstr.h"
 
+namespace llvm {
+
 class MachineInstrBuilder {
   MachineInstr *MI;
 public:
@@ -162,4 +164,6 @@ inline MachineInstrBuilder BuildMI(MachineBasicBlock *BB, int Opcode,
                                                                      MOTy::Def);
 }
 
+} // End llvm namespace
+
 #endif
index 807257e2c55369e0dc1cf4b7645e1cc07a0f8ba8..11fcf29013a8464f63d725d7a741b45ef794231c 100644 (file)
@@ -15,6 +15,8 @@
 #ifndef LLVM_CODEGEN_PASSES_H
 #define LLVM_CODEGEN_PASSES_H
 
+namespace llvm {
+
 class FunctionPass;
 class PassInfo;
 class TargetMachine;
@@ -52,4 +54,6 @@ FunctionPass *createPrologEpilogCodeInserter();
 /// for the Sparc.
 FunctionPass *getRegisterAllocator(TargetMachine &T);
 
+} // End llvm namespace
+
 #endif
index 7f5d5f97e50fa3c418be79f572c02cd07a128647..c31911c91b4d309e166409816d9fe980809b69e6 100644 (file)
@@ -19,6 +19,8 @@
 
 #include "llvm/Target/MRegisterInfo.h"
 
+namespace llvm {
+
 class TargetRegisterClass;
 
 class SSARegMap {
@@ -44,4 +46,6 @@ class SSARegMap {
   }
 };
 
+} // End llvm namespace
+
 #endif
index 874e53d994e242d2ed74eadacc91b649cac149fe..a422d9ae0d18b00889c0f3817e4ac90735e61824 100644 (file)
@@ -18,6 +18,8 @@
 #include "llvm/Value.h"
 #include <vector>
 
+namespace llvm {
+
 class SchedGraphEdge;
 class SchedGraphNode;
 
@@ -217,4 +219,6 @@ public:
   ~SchedGraphCommon();
 };
 
+} // End llvm namespace
+
 #endif
index f132f7b0a258630ae2e5e511b7ab5dce31da34e7..4719bf9d21fd18b7e97d5fd40dbb31ebe0694ced 100644 (file)
@@ -27,6 +27,9 @@
 #include <map>
 #include <vector>
 #include <cassert>
+
+namespace llvm {
+
 class Value;
 class Type;
 class Instruction;
@@ -362,4 +365,6 @@ typedef ReducedValue<uint64_t      , ISD::Constant_i64_Slot> ReducedValue_Consta
 typedef ReducedValue<float         , ISD::Constant_f32_Slot> ReducedValue_Constant_f32;
 typedef ReducedValue<double        , ISD::Constant_f64_Slot> ReducedValue_Constant_f64;
 
+} // End llvm namespace
+
 #endif
index 149506550dae5bed227b699fec48e457697ad9e4..f4bc6e80d444a44d827b4781f11f3c0f50978fa5 100644 (file)
@@ -17,6 +17,9 @@
 #define VALUE_SET_H
 
 #include <set>
+
+namespace llvm {
+
 class Value;
 
 // RAV - Used to print values in a form used by the register allocator.  
@@ -31,4 +34,6 @@ std::ostream &operator<<(std::ostream &out, RAV Val);
 typedef std::set<const Value*> ValueSet;
 void printSet(const ValueSet &S);
 
+} // End llvm namespace
+
 #endif
index dc85ee0d3ce47385670cfcc0e9ee71025c06e2a7..b523b71a14be030a01167bbf8ae8d35d311dda8a 100644 (file)
@@ -16,6 +16,8 @@
 #ifndef LLVM_CODEGEN_VALUETYPES_H
 #define LLVM_CODEGEN_VALUETYPES_H
 
+namespace llvm {
+
 /// MVT namespace - This namespace defines the ValueType enum, which contains
 /// the various low-level value types.
 ///
@@ -40,5 +42,6 @@ namespace MVT {  // MVT = Machine Value Types
   };
 };
 
-#endif
+} // End llvm namespace
 
+#endif
index ac4c82090dbcb8daa5525b5499e4d3d9bfdf094f..fbed6ee0fbf9d281a0a9c8427aebd53bb3987e00 100644 (file)
@@ -16,6 +16,8 @@
 
 #include "llvm/User.h"
 
+namespace llvm {
+
 class Constant : public User {
 protected:
   inline Constant(const Type *Ty) : User(Ty, Value::ConstantVal) {}
@@ -91,4 +93,6 @@ public:
   // END WARNING!!
 };
 
+} // End llvm namespace
+
 #endif
index a27283c44078038d648aaa932093e197ee13d316..a0a01e5306309d71f1cd44c8f1ab8f15f34e5210 100644 (file)
@@ -42,6 +42,9 @@
 
 #include "llvm/Constants.h"
 #include "llvm/Type.h"
+
+namespace llvm {
+
 class PointerType;
 
 //===----------------------------------------------------------------------===//
@@ -244,4 +247,7 @@ Constant *ConstantFoldShiftInstruction(unsigned Opcode, const Constant *V1,
                                        const Constant *V2);
 Constant *ConstantFoldGetElementPtr(const Constant *C,
                                     const std::vector<Constant*> &IdxList);
+
+} // End llvm namespace
+
 #endif
index 077c61c6d5ec99dbf91bcb9132a189d251454808..5d65b2f0c7fd875ce88fa3540d8fc63276c736f4 100644 (file)
@@ -18,6 +18,8 @@
 #include "llvm/Constant.h"
 #include "Support/DataTypes.h"
 
+namespace llvm {
+
 class ArrayType;
 class StructType;
 class PointerType;
@@ -575,4 +577,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif
index 8efe2695a148578acaa98ec56f1f42d17285daa0..8d23df10c0be5c6be5412cf15918c41540d8a964 100644 (file)
@@ -21,6 +21,8 @@
 #include "llvm/Type.h"
 #include <vector>
 
+namespace llvm {
+
 template<class ValType, class TypeClass> class TypeMap;
 class FunctionValType;
 class ArrayValType;
@@ -490,4 +492,6 @@ inline const Type* PATypeHolder::get() const {
   return *const_cast<PATypeHolder*>(this) = NewTy;
 }
 
+} // End llvm namespace
+
 #endif
index c2a0a3a7d20d58f429d9be86a549090dd9379f1d..5dd74b7cdedf295fe459cd885e9418f807b8fdf8 100644 (file)
@@ -19,6 +19,9 @@
 #include <string>
 #include <map>
 #include <cassert>
+
+namespace llvm {
+
 class Constant;
 class Function;
 union GenericValue;
@@ -92,4 +95,6 @@ protected:
   GenericValue LoadValueFromMemory(GenericValue *Ptr, const Type *Ty);
 };
 
+} // End llvm namespace
+
 #endif
index b64eb79bbd48f80c1f344c0a43dc5b9e529072ae..0446795d314d9c4ecb1cd37f20f0af53d5ca4398 100644 (file)
@@ -17,6 +17,8 @@
 
 #include "Support/DataTypes.h"
 
+namespace llvm {
+
 typedef uint64_t PointerTy;
 
 union GenericValue {
@@ -44,4 +46,6 @@ inline GenericValue PTOGV(void *P) { return GenericValue(P); }
 inline void* GVTOP(const GenericValue &GV) {
   return (void*)(intptr_t)GV.PointerVal;
 }
+
+} // End llvm namespace
 #endif
index 3c44b3658f298f89558adeb9a6f332a21dc7cd3b..4dd791ec21c265e26a097144ab8e528af4d21f27 100644 (file)
@@ -22,6 +22,8 @@
 #include "llvm/BasicBlock.h"
 #include "llvm/Argument.h"
 
+namespace llvm {
+
 class FunctionType;
 
 // Traits for intrusive list of instructions...
@@ -95,7 +97,7 @@ public:
   virtual bool isExternal() const { return BasicBlocks.empty(); }
 
   /// getIntrinsicID - This method returns the ID number of the specified
-  /// function, or LLVMIntrinsic::not_intrinsic if the function is not an
+  /// function, or Intrinsic::not_intrinsic if the function is not an
   /// instrinsic, or if the pointer is null.  This value is always defined to be
   /// zero to allow easy checking for whether a function is intrinsic or not.
   /// The particular intrinsic functions which correspond to this value are
@@ -220,4 +222,6 @@ public:
   void dropAllReferences();
 };
 
+} // End llvm namespace
+
 #endif
index f2349bc3cbb6073a1d3e8dfd5a5396b2dca41350..47a2189fa4ae7e2e37241ea1e6188e887558ce97 100644 (file)
@@ -18,6 +18,9 @@
 #define LLVM_GLOBALVALUE_H
 
 #include "llvm/User.h"
+
+namespace llvm {
+
 class PointerType;
 class Module;
 
@@ -71,4 +74,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif
index d1a9a293c664b2eef696593dd88c30d4355dbeb0..03c4f3912024ec68b7c0f3b2ab457ff09fc5c2fc 100644 (file)
@@ -22,6 +22,8 @@
 
 #include "llvm/GlobalValue.h"
 
+namespace llvm {
+
 class Module;
 class Constant;
 class PointerType;
@@ -105,4 +107,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif
index e3d3d61adb1f4327f6e706fa208e4534c7a29cf1..7938b483c7cc60c0d4d80910c019bc93ef3f613d 100644 (file)
@@ -18,6 +18,8 @@
 
 #include "llvm/Instruction.h"
 
+namespace llvm {
+
 //===----------------------------------------------------------------------===//
 //                            TerminatorInst Class
 //===----------------------------------------------------------------------===//
@@ -134,4 +136,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif
index e069e2ca7a6aea17ec9b06d956fef5b66f95306c..4208642d7f1fb25a6a1e62858b6725caddf0ff87 100644 (file)
@@ -15,7 +15,7 @@
 
 // NOTE: NO INCLUDE GUARD DESIRED!
 
-// Provide definitions of macros so that users of this file don't have to define
+// Provide definitions of macros so that users of this file do not have to define
 // everything to use it...
 //
 #ifndef FIRST_TERM_INST
index 264356ca91eaa8572824bedc5c0352a58c568926..cc9a8aec2b129f07ee96dc4241549d906cdae3c7 100644 (file)
@@ -17,6 +17,8 @@
 
 #include "llvm/User.h"
 
+namespace llvm {
+
 class AssemblyAnnotationWriter;
 
 template<typename SC> struct ilist_traits;
@@ -151,4 +153,6 @@ public:
   };
 };
 
+} // End llvm namespace
+
 #endif
index 9d7c7bc9940f465e3787f32852c0820c50ff9883..8ecb6c42ee509316370945c9b478f7405cda006b 100644 (file)
 #ifndef LLVM_INTRINSICS_H
 #define LLVM_INTRINSICS_H
 
-/// LLVMIntrinsic Namespace - This namespace contains an enum with a value for
+namespace llvm {
+
+/// Intrinsic Namespace - This namespace contains an enum with a value for
 /// every intrinsic/builtin function known by LLVM.  These enum values are
 /// returned by Function::getIntrinsicID().
 ///
-namespace LLVMIntrinsic {
+namespace Intrinsic {
   enum ID {
     not_intrinsic = 0,   // Must be zero
 
@@ -125,6 +127,9 @@ namespace LLVMIntrinsic {
                     // second parameter, the possible values for which are
                     // defined in the AlphaSfpToSq enumeration
   };
-}
+
+} // End Intrinsic namespace
+
+} // End llvm namespace
 
 #endif
index ac399034d48b7c443f324952533d457dec5a5d71..9f4c8c25f6db4309ea3148b4473f824eab220c6d 100644 (file)
@@ -15,6 +15,9 @@
 #define LLVM_TRANSFORMATIONS_UTILS_LINKER_H
 
 #include <string>
+
+namespace llvm {
+
 class Module;
 
 // LinkModules - This function links two modules together, with the resulting
@@ -24,5 +27,7 @@ class Module;
 //
 bool LinkModules(Module *Dest, const Module *Src, std::string *ErrorMsg = 0);
 
+} // End llvm namespace
+
 #endif
 
index 19626aea03b3f35e4e128406bc5217f0127d8915..b38269dde027d4aad751012fb5f6eaa3b0bf3df5 100644 (file)
@@ -21,6 +21,9 @@
 
 #include "llvm/Function.h"
 #include "llvm/GlobalVariable.h"
+
+namespace llvm {
+
 class GlobalVariable;
 class GlobalValueRefMap;   // Used by ConstantVals.cpp
 class ConstantPointerRef;
@@ -213,4 +216,6 @@ inline std::ostream &operator<<(std::ostream &O, const Module &M) {
   return O;
 }
 
+} // End llvm namespace
+
 #endif
index 8d4b1d23af5c26948d6b14057307cc6110930e4c..de9616fe2ed2c9fba17c66a86a64fc1fd70ddbe1 100644 (file)
@@ -18,6 +18,8 @@
 #ifndef MODULEPROVIDER_H
 #define MODULEPROVIDER_H
 
+namespace llvm {
+
 class Function;
 class Module;
 
@@ -52,4 +54,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif
index 0d0a6e6fbc07c5491b4e927cb587188994a18598..8a10ead35ef828149f817c13a3b78c7068605216 100644 (file)
@@ -34,6 +34,9 @@
 #include <iosfwd>
 #include <typeinfo>
 #include <cassert>
+
+namespace llvm {
+
 class Value;
 class BasicBlock;
 class Function;
@@ -329,6 +332,8 @@ private:
   virtual void addToPassManager(PassManagerT<BasicBlock> *PM,AnalysisUsage &AU);
 };
 
+} // End llvm namespace
+
 // Include support files that contain important APIs commonly used by Passes,
 // but that we want to separate out to make it easier to read the header files.
 //
index 61fb29fb813b7fb53bb7fb9dadfab259908a0591..f62465a8b8b5949cead86c8228cee40b94aa9087 100644 (file)
@@ -19,6 +19,8 @@
 #ifndef LLVM_PASS_ANALYSIS_SUPPORT_H
 #define LLVM_PASS_ANALYSIS_SUPPORT_H
 
+namespace llvm {
+
 // No need to include Pass.h, we are being included by it!
 
 //===----------------------------------------------------------------------===//
@@ -133,4 +135,6 @@ AnalysisType *Pass::getAnalysisToUpdate() const {
   return dynamic_cast<AnalysisType*>(Resolver->getAnalysisToUpdate(PI));
 }
 
+} // End llvm namespace
+
 #endif
index c47abdaef957e229d3a26daae40b696f9d48cdab..b1d369b925d5ff5014d7d844386ec0e14423f9f6 100644 (file)
@@ -17,6 +17,8 @@
 #ifndef LLVM_PASSMANAGER_H
 #define LLVM_PASSMANAGER_H
 
+namespace llvm {
+
 class Pass;
 class Module;
 class ModuleProvider;
@@ -72,4 +74,6 @@ public:
   bool run(Function &F);
 };
 
+} // End llvm namespace
+
 #endif
index 226ee29357a0e0128aa13a4bb6b10fb33bb11b06..d985bf121d3da598c05983145ce1d38f156196cd 100644 (file)
@@ -23,6 +23,8 @@
 
 // No need to include Pass.h, we are being included by it!
 
+namespace llvm {
+
 class TargetMachine;
 
 //===---------------------------------------------------------------------------
@@ -395,4 +397,7 @@ struct PassRegistrationListener {
 struct IncludeFile {
   IncludeFile(void *);
 };
+
+} // End llvm namespace
+
 #endif
index 7e56de99dca72207fa1b2f60e6117cd6e8ac0c61..596f9324edbae88012850f7b3f8444b6766d3701 100644 (file)
@@ -22,6 +22,9 @@
 
 #include <vector>
 #include <map>
+
+namespace llvm {
+
 class Value;
 class Module;
 class Function;
@@ -92,4 +95,6 @@ protected:
   void processSymbolTableConstants(const SymbolTable *ST);
 };
 
+} // End llvm namespace
+
 #endif
index 075ffc297a4b91a9d0b18cb6b1adf50aadb5d586..cee7ab7d8936ce8ef7c17d27031b263684a4394e 100644 (file)
@@ -25,6 +25,8 @@
 #include <string>
 #include <cassert>
 
+namespace llvm {
+
 class AnnotationID;
 class Annotation;
 class Annotable;
@@ -217,4 +219,6 @@ inline Annotation *Annotable::getOrCreateAnnotation(AnnotationID ID) const {
   return A;
 }
 
+} // End namespace llvm
+
 #endif
index 26616dbb7a04724f46957cdeb85969adb86d266f..bbe1701da1679cac2cae26e45c38d1bfe1bc1a5c 100644 (file)
@@ -20,6 +20,8 @@
 #include "llvm/InstrTypes.h"
 #include "Support/iterator"
 
+namespace llvm {
+
 //===--------------------------------------------------------------------===//
 // BasicBlock pred_iterator definition
 //===--------------------------------------------------------------------===//
@@ -264,4 +266,6 @@ template <> struct GraphTraits<Inverse<const Function*> > :
   }
 };
 
+} // End llvm namespace
+
 #endif
index 5e3fd3e6626a9126c8b3fe9b18a2131582d07116..8f7cf1a7868d55348fd29674e00767c8cf0c1bec 100644 (file)
@@ -23,6 +23,8 @@
 
 #include "llvm/Instruction.h"
 
+namespace llvm {
+
 class CallInst;
 class InvokeInst;
 
@@ -100,4 +102,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif
index 065919c1792a87c71cc491e3c464cb4418f1eeca..4b070c18d85a4d3a3a05cf60cd03b9a7163abe8b 100644 (file)
@@ -15,6 +15,8 @@
 #ifndef SUPPORT_CASTING_H
 #define SUPPORT_CASTING_H
 
+namespace llvm {
+
 //===----------------------------------------------------------------------===//
 //                          isa<x> Support Templates
 //===----------------------------------------------------------------------===//
@@ -293,4 +295,6 @@ void main() {
 
 #endif
 
+} // End llvm namespace
+
 #endif
index 01f55a81d455716cc8e8d82c652427834a90c1a6..df40d80070e2a6a5d941ad788e30233b103fa554 100644 (file)
@@ -27,6 +27,7 @@
 #include <cassert>
 #include "boost/type_traits/object_traits.hpp"
 
+namespace llvm {
 /// cl Namespace - This namespace contains all of the command line option
 /// processing machinery.  It is intentionally a short name to make qualified
 /// usage concise.
@@ -1022,4 +1023,6 @@ struct aliasopt {
 
 } // End namespace cl
 
+} // End namespace llvm
+
 #endif
index c173549a37abcb87b29a16724da40962a2dd50a7..d97b73e82491375744c8ba4d0ca735b1851df20d 100644 (file)
@@ -26,6 +26,9 @@
 
 #include "Support/DataTypes.h"
 #include <iosfwd>
+
+namespace llvm {
+
 class ConstantIntegral;
 class Type;
 
@@ -124,4 +127,6 @@ inline std::ostream &operator<<(std::ostream &OS, const ConstantRange &CR) {
   return OS;
 }
 
+} // End llvm namespace
+
 #endif
index 002a78ec4f8bc4872db8ba9f675e3872826b5dcd..63837b7ddf699bfbf6bf3c1b03b63e67915cee71 100644 (file)
@@ -19,6 +19,8 @@
 
 #include <string>
 
+namespace llvm {
+
 /// DefaultDOTGraphTraits - This class provides the default implementations of
 /// all of the DOTGraphTraits methods.  If a specialization does not need to
 /// override all methods here it should inherit so that it can get the default
@@ -96,4 +98,6 @@ struct DefaultDOTGraphTraits {
 template <typename Ty>
 class DOTGraphTraits : public DefaultDOTGraphTraits {};
 
+} // End llvm namespace
+
 #endif
index 8cba05771fb4b8a3e7c42857cd3b1073aa319fae..66a208811ae0af117d433dc0a027c948fc0ad061 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef SUPPORT_DEBUG_H
 #define SUPPORT_DEBUG_H
 
+namespace llvm {
+
 // DebugFlag - This boolean is set to true if the '-debug' command line option
 // is specified.  This should probably not be referenced directly, instead, use
 // the DEBUG macro below.
@@ -57,4 +59,6 @@ bool isCurrentDebugType(const char *Type);
   do { if (DebugFlag && isCurrentDebugType(DEBUG_TYPE)) { X; } } while (0)
 #endif
 
+} // End llvm namespace
+
 #endif
index 8f02708268e14e11d5a7b8ffdf42fba47eea7aa5..fec9a45296cee48827a46281988d5bb27137ed1e 100644 (file)
@@ -18,6 +18,8 @@
 
 #include <string>
 
+namespace llvm {
+
 /// LinkDynamicObject - Load the named file as a dynamic library
 /// and link it with the currently running process. Returns false
 /// on success, true if there is an error (and sets ErrorMessage
@@ -33,4 +35,6 @@ bool LinkDynamicObject (const char *filename, std::string *ErrorMessage);
 void *GetAddressOfSymbol (const char *symbolName);
 void *GetAddressOfSymbol (const std::string &symbolName);
 
+} // End llvm namespace
+
 #endif // SUPPORT_DYNAMICLINKER_H
index 0dfa625362173a7e765f973ad54f86ea96004d48..c276ec7aaa6538b0aa3fb0683d353f4d13f24769 100644 (file)
@@ -17,6 +17,8 @@
 
 #include <string>
 
+namespace llvm {
+
 /// CheckMagic - Returns true IFF the file named FN begins with Magic. FN must
 /// name a readable file.
 ///
@@ -95,4 +97,6 @@ bool MakeFileExecutable (const std::string & Filename);
 ///
 bool MakeFileReadable (const std::string & Filename);
 
+} // End llvm namespace
+
 #endif
index 2cb8fcc985a875e25c2d9dc24ae7a9cdc7dbc3b9..7e5aa80645b2439a7e329b537336abec8eb8f360 100644 (file)
@@ -28,6 +28,8 @@
 #include <vector>
 #include <iostream>
 
+namespace llvm {
+
 namespace DOT {  // Private functions...
   inline std::string EscapeString(const std::string &Label) {
     std::string Str(Label);
@@ -206,4 +208,6 @@ std::ostream &WriteGraph(std::ostream &O, const GraphType &G,
   return O;
 }
 
+} // End llvm namespace
+
 #endif
index 4c2d185576ba2bb916725c6a1daae4ce3663073b..31c8b660d67ce08e94d2b1d3022314b01f794ea1 100644 (file)
@@ -22,6 +22,8 @@
 #include "llvm/BasicBlock.h"
 #include "llvm/Function.h"
 
+namespace llvm {
+
 // This class implements inst_begin() & inst_end() for
 // inst_iterator and const_inst_iterator's.
 //
@@ -137,4 +139,6 @@ inline const_inst_iterator inst_end(const Function &F) {
   return const_inst_iterator(F, true);
 }
 
+} // End llvm namespace
+
 #endif
index de1bce96bbc09fa5208d44bc68bd9fce8d112119..9a34edb71f10b665065c46d9f7b25f17dc8f1924 100644 (file)
@@ -52,6 +52,8 @@
 
 #include "llvm/Instruction.h"
 
+namespace llvm {
+
 class Module;
 
 // We operate on opaque instruction classes, so forward declare all instruction
@@ -64,7 +66,6 @@ class Module;
 class TerminatorInst; class BinaryOperator;
 class AllocationInst;
 
-
 #define DELEGATE(CLASS_TO_VISIT) \
   return ((SubClass*)this)->visit##CLASS_TO_VISIT((CLASS_TO_VISIT&)I)
 
@@ -186,4 +187,6 @@ struct InstVisitor {
 
 #undef DELEGATE
 
+} // End llvm namespace
+
 #endif
index b39e0b591106adf9311669413ae4a5bfb5cee15a..e2ce9c50beac954bc158833121cd9bce656de589 100644 (file)
@@ -23,6 +23,9 @@
 #define SUPPORT_LEAKDETECTOR_H
 
 #include <string>
+
+namespace llvm {
+
 class Value;
 
 struct LeakDetector {
@@ -83,4 +86,6 @@ private:
   static void checkForGarbageImpl(const std::string &Message);
 };
 
+} // End llvm namespace
+
 #endif
index ac399034d48b7c443f324952533d457dec5a5d71..9f4c8c25f6db4309ea3148b4473f824eab220c6d 100644 (file)
@@ -15,6 +15,9 @@
 #define LLVM_TRANSFORMATIONS_UTILS_LINKER_H
 
 #include <string>
+
+namespace llvm {
+
 class Module;
 
 // LinkModules - This function links two modules together, with the resulting
@@ -24,5 +27,7 @@ class Module;
 //
 bool LinkModules(Module *Dest, const Module *Src, std::string *ErrorMsg = 0);
 
+} // End llvm namespace
+
 #endif
 
index 1ba25b0d65efd83e14df584bf9b1acd497fceda8..766a67fa22f1c5204c214be6c652e3534cb87814 100644 (file)
@@ -23,6 +23,8 @@
 #include <cstdlib>
 #include <memory>
 
+namespace llvm {
+
 template<typename T>
 struct MallocAllocator {
   typedef size_t size_type;
@@ -79,5 +81,6 @@ namespace std {
   };
 }
 
+} // End llvm namespace
 
 #endif
index 1f56ff319e41ad8e1bd7dbcd54ffe24b2b2b37fc..5b312f8ef447a7186a1e12b04bb109e98da429d6 100644 (file)
 #ifndef LLVM_SUPPORT_MANGLER_H
 #define LLVM_SUPPORT_MANGLER_H
 
+namespace llvm {
+
 class Value;
 class Module;
+
+} // End llvm namespace
+
 #include <map>
 #include <set>
 #include <string>
 
+namespace llvm {
+
 class Mangler {
   /// This keeps track of which global values have had their names
   /// mangled in the current module.
@@ -54,4 +61,6 @@ public:
   static std::string makeNameProper(const std::string &x);
 };
 
+} // End llvm namespace
+
 #endif // LLVM_SUPPORT_MANGLER_H
index ec742324b0083727c8d80ae2cf42eea75d163f64..74958fbc3570bc61d79c2678a043ba54d2e8fc1c 100644 (file)
@@ -16,6 +16,8 @@
 
 #include "Support/DataTypes.h"
 
+namespace llvm {
+
 inline unsigned log2(uint64_t C) {
   unsigned getPow;
   for (getPow = 0; C > 1; ++getPow)
@@ -33,4 +35,6 @@ inline bool isPowerOf2(int64_t C, unsigned &getPow) {
   return false;
 }
 
+} // End llvm namespace
+
 #endif
index f63666ba668d9aa3d87e3746d395f0469e514c8c..0ffcabad52ae61e3f4804f7ddfd30b652fe08e04 100644 (file)
@@ -28,6 +28,8 @@
 #include <algorithm>
 #include <iostream>
 
+namespace llvm {
+
 //===----------------------------------------------------------------------===//
 // PassNameParser class - Make use of the pass registration mechanism to
 // automatically add a command line argument to opt for each pass.
@@ -114,4 +116,6 @@ struct FilteredPassNameParser : public PassNameParser {
   }
 };
 
+} // End llvm namespace
+
 #endif
index ccde86cce697e81b53d79d6409f8e648cb477cff..c874d9932c05c45070c3425d82fd2308c5feee6a 100644 (file)
@@ -17,6 +17,8 @@
 
 #include <string>
 
+namespace llvm {
+
 /// isExecutableFile - This function returns true if the filename specified
 /// exists and is executable.
 ///
@@ -45,4 +47,7 @@ int RunProgramWithTimeout(const std::string &ProgramPath, const char **Args,
 /// wait for it to terminate.
 ///
 int ExecWait (const char * const argv[], const char * const envp[]);
+
+} // End llvm namespace
+
 #endif
index 57ef3f0d6489a86d6bd7917c05701ea0b891a85d..ac465bb95b2d5eadbd909490997500985afb8dd8 100644 (file)
@@ -20,6 +20,8 @@
 #include <iosfwd>
 #include <cassert>
 
+namespace llvm {
+
 class TimerGroup;
 
 /// Timer - This class is used to track the amount of time spent between
@@ -157,4 +159,6 @@ private:
   }
 };
 
+} // End llvm namespace
+
 #endif
index e23ec7f312d65ae043a1836c47457965d79a50c9..8ce3f5d8f37cce65c77a63f8f230b2f02d4c3b62 100644 (file)
@@ -20,6 +20,8 @@
 #include "Support/SystemUtils.h"
 #include <vector>
 
+namespace llvm {
+
 class CBE;
 class LLC;
 
@@ -137,4 +139,6 @@ public:
   int OutputAsm(const std::string &Bytecode, std::string &OutputAsmFile);
 };
 
+} // End llvm namespace
+
 #endif
index aa2093a43db2c96361b74ce347a05138a0bccf86..5d9035076f3353842d3c56b2dacc8a49b14e5df8 100644 (file)
@@ -18,6 +18,8 @@
 
 #include <typeinfo>
 
+namespace llvm {
+
 struct TypeInfo {
   TypeInfo() {                     // needed for containers
     struct Nil {};  // Anonymous class distinct from all others...
@@ -69,4 +71,6 @@ inline bool operator>=(const TypeInfo &lhs, const TypeInfo &rhs) {
   return !(lhs < rhs);
 }
 
+} // End llvm namespace
+
 #endif
index 62ab9d9ca29bb8fd90268ef86b68d19704176836..bab201287eb9f9a7ab9ffc627e78c99fdb727b78 100644 (file)
@@ -20,6 +20,8 @@
 
 #include "llvm/User.h"
 
+namespace llvm {
+
 struct ValueHolder : public User {
   ValueHolder(Value *V = 0);
   ValueHolder(const ValueHolder &VH) : User(VH.getType(), Value::TypeVal) {
@@ -46,4 +48,6 @@ struct ValueHolder : public User {
   }
 };
 
+} // End llvm namespace
+
 #endif
index 42f15aa626e92173e396672c95c9b7efabe6f0ad..850237558101b7c2d293a0d33921deaa7456a487 100644 (file)
@@ -26,6 +26,8 @@
 #include "llvm/Value.h"
 #include <map>
 
+namespace llvm {
+
 class SymbolTable : public AbstractTypeUser,
                    public std::map<const Type *, 
                                     std::map<const std::string, Value *> > {
@@ -132,4 +134,6 @@ private:
   virtual void typeBecameConcrete(const DerivedType *AbsTy);
 };
 
+} // End llvm namespace
+
 #endif
index 820f391d40b9b7580de1738b287bc9bd10d6f13e..46be35615151221cc930d4125472df152bcabe0a 100644 (file)
@@ -25,6 +25,8 @@
 #ifndef LLVM_SYMBOLTABLELISTTRAITS_H
 #define LLVM_SYMBOLTABLELISTTRAITS_H
 
+namespace llvm {
+
 template<typename NodeTy> class ilist_iterator;
 template<typename NodeTy, typename Traits> class iplist;
 template<typename Ty> struct ilist_traits;
@@ -72,4 +74,6 @@ public:
   void setParent(SymTabClass *Parent);  // This is private!
 };
 
+} // End llvm namespace
+
 #endif
index ce12301a15c508c98cf67b9df54387379a08a78d..0cbf398798a17741bdb81d545f7eba6d8bb239e2 100644 (file)
 
 #include <string>
 
+namespace llvm {
+
 // RemoveFileOnSignal - This function registers signal handlers to ensure that
 // if a signal gets delivered that the named file is removed.
 //
 void RemoveFileOnSignal(const std::string &Filename);
 
-#endif
+} // End llvm namespace
 
+#endif
index a87c74fc4ec7f9d4c293e0328a0b927aa5eebac9..3217b47b7299212ecca1e48cd62e4f713baf7586 100644 (file)
@@ -19,6 +19,8 @@
 #include "llvm/CodeGen/MachineBasicBlock.h"
 #include <cassert>
 
+namespace llvm {
+
 class Type;
 class MachineFunction;
 
@@ -280,4 +282,6 @@ public:
                            MachineBasicBlock &MBB) const = 0;
 };
 
+} // End llvm namespace
+
 #endif
index 56f20bf52489ae74778bc8ae79125274c705fc3c..357adf0685128768df644d8c6e72ec874de40fe8 100644 (file)
@@ -16,6 +16,8 @@
 
 #include "Support/DataTypes.h"
 
+namespace llvm {
+
 class TargetMachine;
 
 struct TargetCacheInfo {
@@ -59,4 +61,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif
index 8dcb6255d45b30089d518be4292244f3b5af8b44..9be9564f164a049bcfab7bf341fd6728c36dad5f 100644 (file)
@@ -24,6 +24,9 @@
 #include "Support/Annotation.h"
 #include "Support/DataTypes.h"
 #include <vector>
+
+namespace llvm {
+
 class Value;
 class Type;
 class StructType;
@@ -101,4 +104,6 @@ private:
   inline StructLayout(const StructType *ST, const TargetData &TD);
 };
 
+} // End llvm namespace
+
 #endif
index 0f82e27470adf323586e2e14582a6e7aa321fcf7..2b968fab1a12ec45d54891cdda1f0e0bc3334c71 100644 (file)
@@ -14,6 +14,8 @@
 #ifndef LLVM_TARGET_TARGETFRAMEINFO_H
 #define LLVM_TARGET_TARGETFRAMEINFO_H
 
+namespace llvm {
+
 class MachineFunction;
 
 struct TargetFrameInfo {
@@ -99,4 +101,6 @@ public:
   virtual int getDynamicAreaBaseRegNum()               const { abort(); }
 };
 
+} // End llvm namespace
+
 #endif
index 76cfb392aef367149097822df9742782beba4807..c6afba5a15624ddb3cc9dd4cb9e7cd2a65a20198 100644 (file)
@@ -18,6 +18,8 @@
 #include <vector>
 #include <cassert>
 
+namespace llvm {
+
 class MachineInstr;
 class TargetMachine;
 class Value;
@@ -415,4 +417,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif
index af06349aa9c33190426feee9d7157d7057a4c8df..c0771a17468f22cee3fcada7199602d7cbbe0462 100644 (file)
@@ -17,6 +17,8 @@
 #include "llvm/Target/TargetData.h"
 #include <cassert>
 
+namespace llvm {
+
 class TargetInstrInfo;
 class TargetInstrDescriptor;
 class TargetSchedInfo;
@@ -117,4 +119,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif
index 670b2dc4b660a7134a4aa77c2df2620ee83db71d..3ca20c74e9915c1b16f9dd6eb8e3e3dec618f606 100644 (file)
@@ -15,6 +15,8 @@
 #ifndef LLVM_TARGET_TARGETMACHINEIMPLS_H
 #define LLVM_TARGET_TARGETMACHINEIMPLS_H
 
+namespace llvm {
+
 class TargetMachine;
 class Module;
 
@@ -30,4 +32,6 @@ TargetMachine *allocateSparcTargetMachine(const Module &M);
 //
 TargetMachine *allocateX86TargetMachine(const Module &M);
 
+} // End llvm namespace
+
 #endif
index 36bfc0b9150ed50b89a9ca9b8c4a9989df848a71..f9f67c74240fffc0ddf4b93812c761b27a0a4cb7 100644 (file)
@@ -19,6 +19,8 @@
 #include <string>
 #include <cassert>
 
+namespace llvm {
+
 class TargetMachine;
 class IGNode;
 class Type;
@@ -289,4 +291,6 @@ public:
   virtual int getSpilledRegSize(int RegType) const = 0;
 };
 
+} // End llvm namespace
+
 #endif
index dd8df3204482dfa30586b4ae4c59de6151a616d8..ae97d109e3317d01c90f184669d302f541685d8a 100644 (file)
@@ -18,6 +18,8 @@
 #include "Support/hash_map"
 #include <string>
 
+namespace llvm {
+
 typedef long long cycles_t; 
 static const cycles_t HUGE_LATENCY = ~((long long) 1 << (sizeof(cycles_t)-2));
 static const cycles_t INVALID_LATENCY = -HUGE_LATENCY; 
@@ -36,13 +38,17 @@ private:
   OpCodePair();                        // disable for now
 };
 
+} // End llvm namespace
+
 namespace HASH_NAMESPACE {
-  template <> struct hash<OpCodePair> {
-    size_t operator()(const OpCodePair& pair) const {
+  template <> struct hash<llvm::OpCodePair> {
+    size_t operator()(const llvm::OpCodePair& pair) const {
       return hash<long>()(pair.val);
     }
   };
-}
+} // End HASH_NAMESPACE (a macro) namespace
+
+namespace llvm {
 
 //---------------------------------------------------------------------------
 // class MachineResource 
@@ -321,4 +327,6 @@ protected:
   
 };
 
+} // End llvm namespace
+
 #endif
index 62ed93c5bbf61995743a6fe11132a6f1a6e95084..80f5a527ab1029478c66fd8898322a1eb25f0488 100644 (file)
@@ -15,6 +15,8 @@
 #ifndef LLVM_TRANSFORMS_IPO_H
 #define LLVM_TRANSFORMS_IPO_H
 
+namespace llvm {
+
 class Pass;
 class Function;
 
@@ -119,4 +121,6 @@ Pass *createIPConstantPropagationPass();
 Pass *createSwapElementsPass();
 Pass *createSortElementsPass();
 
+} // End llvm namespace
+
 #endif
index abe4fc46f6e4fa5c95d7c991418f8ef6cfa7c8e9..035b8d1e0c1476ea789f55d9bd4ebd1c3af1a730 100644 (file)
@@ -14,6 +14,8 @@
 #ifndef LLVM_TRANSFORMS_INSTRUMENTATION_H
 #define LLVM_TRANSFORMS_INSTRUMENTATION_H
 
+namespace llvm {
+
 class Pass;
 
 //===----------------------------------------------------------------------===//
@@ -23,4 +25,6 @@ class Pass;
 Pass *createTraceValuesPassForFunction();     // Just trace function entry/exit
 Pass *createTraceValuesPassForBasicBlocks();  // Trace BB's and methods
 
+} // End llvm namespace
+
 #endif
index f9b753caf44b39cb949252bbe270c68d3640af47..c68f2ddf2738dae98a55844596c0a2dc9bad3499 100644 (file)
@@ -24,6 +24,8 @@
 #include "llvm/Pass.h"
 #include "llvm/AbstractTypeUser.h"
 
+namespace llvm {
+
 class Value;
 class Type;
 class StructType;
@@ -111,4 +113,6 @@ private:
                      unsigned idx = 0);
 };
 
+} // End llvm namespace
+
 #endif
index 81fd59767d7aeacd02dc699a9e1deaca3b488957..da17b8d10cc30ee563ffc1f8bf5e5153748545db 100644 (file)
@@ -15,6 +15,8 @@
 #ifndef LLVM_TRANSFORMS_SCALAR_H
 #define LLVM_TRANSFORMS_SCALAR_H
 
+namespace llvm {
+
 class Pass;
 class FunctionPass;
 class GetElementPtrInst;
@@ -268,4 +270,6 @@ FunctionPass *createLowerInvokePass();
 Pass *createSymbolStrippingPass();
 Pass *createFullSymbolStrippingPass();
 
+} // End llvm namespace
+
 #endif
index 4630d5399af7fbb9d594bc89e159e68694457f61..155eae8e36b73b9a9026485dace0e4919aecb54d 100644 (file)
@@ -19,6 +19,9 @@
 
 #include "llvm/BasicBlock.h"
 #include "llvm/Support/CFG.h"
+
+namespace llvm {
+
 class Instruction;
 class Pass;
 
@@ -50,7 +53,6 @@ void ReplaceInstWithInst(Instruction *From, Instruction *To);
 //
 void RemoveSuccessor(TerminatorInst *TI, unsigned SuccNum);
 
-
 /// isCriticalEdge - Return true if the specified edge is a critical edge.
 /// Critical edges are edges from a block with multiple successors to a block
 /// with multiple predecessors.
@@ -82,5 +84,6 @@ inline bool SplitCriticalEdge(BasicBlock *Succ, pred_iterator PI, Pass *P = 0) {
   return MadeChange;
 }
 
+} // End llvm namespace
 
 #endif
index 351deefa8cdd67d6317dc2671277858b98c4dcb0..f6351d487624dc6fe0463a06e55d89657bc48fee 100644 (file)
@@ -20,6 +20,9 @@
 
 #include <vector>
 #include <map>
+
+namespace llvm {
+
 class Module;
 class Function;
 class BasicBlock;
@@ -109,4 +112,6 @@ bool InlineFunction(CallSite CS);
 /// no jump to it) and returns the new vector of basic blocks.
 std::vector<BasicBlock *> CloneTrace(const std::vector<BasicBlock*> &origTrace);
 
+} // End llvm namespace
+
 #endif
index 1d6d2c65957f5509ed384ab9b306c806f17294b1..5810087f82df8649eb9efc85f3703b1a24d17c9b 100644 (file)
 //
 //===----------------------------------------------------------------------===//
 
+namespace llvm {
+
 class Instruction;
 class AllocaInst;
 
 AllocaInst *DemoteRegToStack(Instruction &X);
+
+} // End llvm namespace
index ac399034d48b7c443f324952533d457dec5a5d71..9f4c8c25f6db4309ea3148b4473f824eab220c6d 100644 (file)
@@ -15,6 +15,9 @@
 #define LLVM_TRANSFORMATIONS_UTILS_LINKER_H
 
 #include <string>
+
+namespace llvm {
+
 class Module;
 
 // LinkModules - This function links two modules together, with the resulting
@@ -24,5 +27,7 @@ class Module;
 //
 bool LinkModules(Module *Dest, const Module *Src, std::string *ErrorMsg = 0);
 
+} // End llvm namespace
+
 #endif
 
index 286aef993e00978c90c5932765c512753fcf9fbf..2f83174249c2937ed32a362400f0576f093017bf 100644 (file)
@@ -16,6 +16,9 @@
 #define LLVM_TRANSFORMS_UTILS_LOCAL_H
 
 #include "llvm/Function.h"
+
+namespace llvm {
+
 class Pass;
 
 //===----------------------------------------------------------------------===//
@@ -67,4 +70,6 @@ bool dceInstruction(BasicBlock::iterator &BBI);
 ///
 bool SimplifyCFG(BasicBlock *BB);
 
+} // End llvm namespace
+
 #endif
index 57d5dae43c3b91f7a92951daa1980bb3c396a17a..38ea373885a6746e0d2a255446fbcc341994060f 100644 (file)
 #ifndef TRANSFORMS_UTILS_PROMOTEMEMTOREG_H
 #define TRANSFORMS_UTILS_PROMOTEMEMTOREG_H
 
+#include <vector>
+
+namespace llvm {
+
 class AllocaInst;
 class DominatorTree;
 class DominanceFrontier;
 class TargetData;
-#include <vector>
 
 /// isAllocaPromotable - Return true if this alloca is legal for promotion.
 /// This is true if there are only loads and stores to the alloca...
@@ -35,4 +38,6 @@ void PromoteMemToReg(const std::vector<AllocaInst*> &Allocas,
                      DominatorTree &DT, DominanceFrontier &DF,
                      const TargetData &TD);
 
+} // End llvm namespace
+
 #endif
index a59517c689d8f1973b2f22079ea51ebde4260d98..590d51034bdfd421627575d99d90f4ac6bbc95b9 100644 (file)
@@ -20,6 +20,8 @@
 
 #include "llvm/Pass.h"
 
+namespace llvm {
+
 struct UnifyFunctionExitNodes : public FunctionPass {
   BasicBlock *ReturnBlock, *UnwindBlock;
 public:
@@ -39,4 +41,6 @@ public:
 
 Pass *createUnifyFunctionExitNodesPass();
 
+} // End llvm namespace
+
 #endif
index 566a9a3f026864c13c126ad3a65baf5ac39437c8..6101cd0aa02546e760d9e0b6f97e1e285aae1471 100644 (file)
@@ -16,7 +16,7 @@
 // NOTE: NO INCLUDE GUARD DESIRED!
 
 
-// If the user didn't specify one of the macros, give a default noop defn.
+// If the user did not specify one of the macros, give a default noop defn.
 //
 #ifndef HANDLE_PRIM_TYPE
 #define HANDLE_PRIM_TYPE(x,y)
index 4c9fd1db489e9938372be88d7e590c5a34d4adc8..ba4ac3415fd2d3b037cb3a3b2543c7a03df4a599 100644 (file)
@@ -37,6 +37,8 @@
 #include "Support/GraphTraits.h"
 #include "Support/iterator"
 
+namespace llvm {
+
 class DerivedType;
 class FunctionType;
 class ArrayType;
@@ -324,4 +326,6 @@ template <> inline bool isa_impl<PointerType, Type>(const Type &Ty) {
   return Ty.getPrimitiveID() == Type::PointerTyID;
 }
 
+} // End llvm namespace
+
 #endif
index 4deee300f68059e4360a607b247f627aedb1df88..f94045b39e4c7d0c994a7b160ab9ba04edd51d0f 100644 (file)
@@ -17,6 +17,9 @@
 #define LLVM_USE_H
 
 #include "Support/ilist"
+
+namespace llvm {
+
 template<typename NodeTy> struct ilist_traits;
 class Value;
 class User;
@@ -77,13 +80,13 @@ struct ilist_traits<Use> {
 };
 
 
-template<> struct simplify_type<Use> {
+template<> struct std::simplify_type<Use> {
   typedef Value* SimpleType;
   static SimpleType getSimplifiedValue(const Use &Val) {
     return (SimpleType)Val.get();
   }
 };
-template<> struct simplify_type<const Use> {
+template<> struct std::simplify_type<const Use> {
   typedef Value* SimpleType;
   static SimpleType getSimplifiedValue(const Use &Val) {
     return (SimpleType)Val.get();
@@ -150,4 +153,6 @@ struct UseListConstIteratorWrapper : public iplist<Use>::const_iterator {
   }
 };
 
+} // End llvm namespace
+
 #endif
index aba56d5819ef1242a8cc643832165517bbad936f..cdd9b539ca4f17b752db178d25e897c6ab812b77 100644 (file)
@@ -22,6 +22,8 @@
 #include "llvm/Value.h"
 #include <vector>
 
+namespace llvm {
+
 class User : public Value {
   User(const User &);             // Do not implement
 protected:
@@ -110,4 +112,6 @@ template<> struct simplify_type<User::const_op_iterator> {
 template<> struct simplify_type<const User::const_op_iterator>
   : public simplify_type<User::const_op_iterator> {};
 
+} // End llvm namespace
+
 #endif
index 537bcba11bd5c0f2a3f313cc2b4a011da9a44963..e92d6fc6cbc6daf4a1514e6e1c8f14edd922bd86 100644 (file)
@@ -23,6 +23,8 @@
 #include "Support/Casting.h"
 #include <iostream>
 
+namespace llvm {
+
 class Type;
 class Constant;
 class Argument;
@@ -198,4 +200,6 @@ template <> inline bool isa_impl<GlobalValue, Value>(const Value &Val) {
   return isa<GlobalVariable>(Val) || isa<Function>(Val);
 }
 
+} // End llvm namespace
+
 #endif
index db82b54c017e0aeefa76d80e474359d8b93c178c..e0a551a0f749e6ff25664980e4e6caed7da1a7c4 100644 (file)
@@ -16,6 +16,9 @@
 #define LLVM_IMEMORY_H
 
 #include "llvm/Instruction.h"
+
+namespace llvm {
+
 class PointerType;
 
 //===----------------------------------------------------------------------===//
@@ -296,4 +299,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif // LLVM_IMEMORY_H
index 39bfe14660cc87ccabadb27790aebb6ab7575072..ecf99172a1e218a37f83ef62c624a9db08ec3b31 100644 (file)
@@ -16,6 +16,8 @@
 
 #include "llvm/InstrTypes.h"
 
+namespace llvm {
+
 /// SetCondInst class - Represent a setCC operator, where CC is eq, ne, lt, gt,
 /// le, or ge.
 ///
@@ -63,4 +65,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif
index 4e23afdc89879482e9ac5f707334180ff8460113..c611e06612edbef1052269d46e67a11918641737 100644 (file)
@@ -17,6 +17,8 @@
 
 #include "llvm/InstrTypes.h"
 
+namespace llvm {
+
 //===----------------------------------------------------------------------===//
 //                                 CastInst Class
 //===----------------------------------------------------------------------===//
@@ -195,4 +197,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif
index 54b867d59d49e0a5e064aa80d8ec70f92169eed7..191de040e7016adc76911ddc0ba0f06d7e3e3a5b 100644 (file)
@@ -15,6 +15,9 @@
 #define LLVM_IPHINODE_H
 
 #include "llvm/Instruction.h"
+
+namespace llvm {
+
 class BasicBlock;
 
 //===----------------------------------------------------------------------===//
@@ -112,4 +115,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif
index 5f435a05c6f28b05c9635bdf9938d0623caf40cc..93e3adce760edfae33871cbe0c4a12f789264243 100644 (file)
@@ -18,6 +18,8 @@
 
 #include "llvm/InstrTypes.h"
 
+namespace llvm {
+
 //===---------------------------------------------------------------------------
 // ReturnInst - Return a value (possibly void), from a function.  Execution does
 //              not continue in this function any longer.
@@ -306,4 +308,6 @@ struct UnwindInst : public TerminatorInst {
   }
 };
 
+} // End llvm namespace
+
 #endif
index 3acdf7841da775e93cf081920427043a88de6846..c881ec283a91058f7e5d7885807e827a28e3a960 100644 (file)
@@ -29,6 +29,8 @@
 #include "llvm/iMemory.h"
 #include "llvm/Target/TargetData.h"
 
+namespace llvm {
+
 // Register the AliasAnalysis interface, providing a nice name to refer to.
 namespace {
   RegisterAnalysisGroup<AliasAnalysis> Z("Alias Analysis");
@@ -123,3 +125,5 @@ namespace {
   // Declare that we implement the AliasAnalysis interface
   RegisterAnalysisGroup<AliasAnalysis, NoAA> Y;
 }  // End of anonymous namespace
+
+} // End llvm namespace
index 5820565223305c0f2ebb6864b12318ff672160ea..59036a4c39cb630082b369cb8f408eab583e2f6a 100644 (file)
@@ -16,6 +16,8 @@
 #include "llvm/Pass.h"
 #include <iostream>
 
+namespace llvm {
+
 namespace {
   class AliasAnalysisCounter : public Pass, public AliasAnalysis {
     unsigned No, May, Must;
@@ -108,3 +110,5 @@ namespace {
   X("count-aa", "Count Alias Analysis Query Responses");
   RegisterAnalysisGroup<AliasAnalysis, AliasAnalysisCounter> Y;
 }
+
+} // End llvm namespace
index d4a7d18dcd4378c15590f57c96338219bf013ebd..2c967c5daa2da236119a3bcaee5220f8e589ea7a 100644 (file)
@@ -26,6 +26,8 @@
 #include "Support/CommandLine.h"
 #include <set>
 
+namespace llvm {
+
 namespace {
   cl::opt<bool> PrintNo  ("print-no-aliases", cl::ReallyHidden);
   cl::opt<bool> PrintMay ("print-may-aliases", cl::ReallyHidden);
@@ -114,3 +116,5 @@ bool AAEval::doFinalization(Module &M) {
             << May*100/Sum << "%/" << Must*100/Sum<<"%\n";
   return false;
 }
+
+} // End llvm namespace
index c2800326c20f946b3dafc92054575c6550593707..4a293448ed32106417384824cbef5461109c4e1b 100644 (file)
@@ -21,6 +21,8 @@
 #include "llvm/Assembly/Writer.h"
 #include "llvm/Support/InstIterator.h"
 
+namespace llvm {
+
 /// mergeSetIn - Merge the specified alias set into this alias set...
 ///
 void AliasSet::mergeSetIn(AliasSet &AS) {
@@ -294,7 +296,6 @@ void AliasSetTracker::print(std::ostream &OS) const {
 void AliasSet::dump() const { print (std::cerr); }
 void AliasSetTracker::dump() const { print(std::cerr); }
 
-
 //===----------------------------------------------------------------------===//
 //                            AliasSetPrinter Pass
 //===----------------------------------------------------------------------===//
@@ -328,3 +329,5 @@ namespace {
   RegisterPass<AliasSetPrinter> X("print-alias-sets", "Alias Set Printer",
                                   PassInfo::Analysis | PassInfo::Optimization);
 }
+
+} // End llvm namespace
index e60922ac0497278db7f361db83ebac476c0a0c3a..16512c0e1763176a251d636ab9def46ac73bff3f 100644 (file)
 #include "llvm/DerivedTypes.h"
 #include "llvm/Target/TargetData.h"
 
+namespace llvm {
+
 // Make sure that anything that uses AliasAnalysis pulls in this file...
 void BasicAAStub() {}
 
-
 namespace {
   struct BasicAliasAnalysis : public ImmutablePass, public AliasAnalysis {
     
@@ -60,8 +61,6 @@ void BasicAliasAnalysis::initializePass() {
   InitializeAliasAnalysis(this);
 }
 
-
-
 // hasUniqueAddress - Return true if the specified value points to something
 // with a unique, discernable, address.
 static inline bool hasUniqueAddress(const Value *V) {
@@ -364,3 +363,4 @@ BasicAliasAnalysis::CheckGEPInstructions(GetElementPtrInst *GEP1, unsigned G1S,
   return MayAlias;
 }
 
+} // End llvm namespace
index ac93d4c1ca0afdb84520a57d5993be1ebbb64b17..bd11522c961715d82417c421ee848d7e897bd775 100644 (file)
@@ -26,6 +26,8 @@
 #include <sstream>
 #include <fstream>
 
+namespace llvm {
+
 /// CFGOnly flag - This is used to control whether or not the CFG graph printer
 /// prints out the contents of basic blocks or not.  This is acceptable because
 /// this code is only really used for debugging purposes.
@@ -112,9 +114,6 @@ namespace {
                                   "Print CFG of function to 'dot' file");
 };
 
-
-
-
 /// viewCFG - This function is meant for use from the debugger.  You can just
 /// say 'call F->viewCFG()' and a ghostview window should pop up from the
 /// program, displaying the CFG of the current function.  This depends on there
@@ -154,3 +153,5 @@ void Function::viewCFGOnly() const {
   viewCFG();
   CFGOnly = false;
 }
+
+} // End llvm namespace
index a9e1204de52db2999ff1cb2422e5d2dde56cebaf..e180f12a1a045f2b7fa14fa731c90bc8d266e081 100644 (file)
@@ -26,6 +26,8 @@
 #include "llvm/Instruction.h"
 #include "llvm/ConstantHandling.h"
 
+namespace llvm {
+
 /// Initialize a full (the default) or empty set for the specified type.
 ///
 ConstantRange::ConstantRange(const Type *Ty, bool Full) {
@@ -248,3 +250,5 @@ void ConstantRange::print(std::ostream &OS) const {
 void ConstantRange::dump() const {
   print(std::cerr);
 }
+
+} // End llvm namespace
index b4b2e48b4efedb2717450a7ac4f8f17de6b6037a..66990fd9230ff66b01937385175f55b1274f14c3 100644 (file)
@@ -20,6 +20,8 @@
 #include "Support/Debug.h"
 #include "DSCallSiteIterator.h"
 
+namespace llvm {
+
 namespace {
   Statistic<> MaxSCC("budatastructure", "Maximum SCC Size in Call Graph");
   Statistic<> NumBUInlines("budatastructures", "Number of graphs inlined");
@@ -316,3 +318,4 @@ void BUDataStructures::calculateGraph(DSGraph &Graph) {
   //Graph.writeGraphToFile(std::cerr, "bu_" + F.getName());
 }
 
+} // End llvm namespace
index 324111cffad3067dbf70047664ceaa7a9f0db696..df9f36908aeb8163b79742e6643751866317a496 100644 (file)
@@ -19,6 +19,8 @@
 #include "llvm/Analysis/DSGraph.h"
 #include "llvm/Function.h"
 
+namespace llvm {
+
 struct DSCallSiteIterator {
   // FCs are the edges out of the current node are the call site targets...
   const std::vector<DSCallSite> *FCs;
@@ -129,4 +131,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif
index d53c7fa5d7bae57ef427c4fa17dad7451a0e829a..9cf77ae1229cead4c3debbeb91643244cc918835 100644 (file)
@@ -23,6 +23,8 @@
 #include "Support/Timer.h"
 #include <algorithm>
 
+namespace llvm {
+
 namespace {
   Statistic<> NumFolds          ("dsnode", "Number of nodes completely folded");
   Statistic<> NumCallNodesMerged("dsnode", "Number of call nodes merged");
@@ -161,7 +163,6 @@ bool DSNode::isNodeCompletelyFolded() const {
   return getSize() == 1 && Ty == Type::VoidTy && isArray();
 }
 
-
 namespace {
   /// TypeElementWalker Class - Used for implementation of physical subtyping...
   ///
@@ -252,7 +253,7 @@ namespace {
       }
     }
   };
-}
+} // end anonymous namespace
 
 /// ElementTypesAreCompatible - Check to see if the specified types are
 /// "physically" compatible.  If so, return true, else return false.  We only
@@ -1639,6 +1640,7 @@ void DSGraph::mergeInGlobalsGraph() {
   removeTriviallyDeadNodes();
 }
 
+
 /// computeNodeMapping - Given roots in two different DSGraphs, traverse the
 /// nodes reachable from the two graphs, computing the mapping of nodes from
 /// the first to the second graph.
@@ -1669,3 +1671,4 @@ void DSGraph::computeNodeMapping(const DSNodeHandle &NH1,
       computeNodeMapping(N1->getLink(i), N2->getLink(N2Idx+i), NodeMap);
 }
 
+} // End llvm namespace
index 99773e3936eef127d01191e10449aee5d76ca70d..4b55da7aa5442fbbd7208fca47be506ac36b4576 100644 (file)
@@ -17,6 +17,8 @@
 #include "llvm/Analysis/AliasAnalysis.h"
 #include "llvm/Module.h"
 
+namespace llvm {
+
 namespace {
   class DSAA : public Pass, public AliasAnalysis {
     TDDataStructures *TD;
@@ -176,3 +178,5 @@ void DSAA::getMustAliases(Value *P, std::vector<Value*> &RetVals) {
 #endif
   return getAnalysis<AliasAnalysis>().getMustAliases(P, RetVals);
 }
+
+} // End llvm namespace
index 0ca7d6bffc017450b695ee9d4934a2152dc5a8c0..d037b52145ec2cc48fdcc0a4ce4fba66be54a962 100644 (file)
@@ -18,6 +18,8 @@
 #include "llvm/Constant.h"
 #include "Support/Statistic.h"
 
+namespace llvm {
+
 namespace {
   Statistic<>
   NumGlobalsConstanted("ds-opt", "Number of globals marked constant");
@@ -47,7 +49,6 @@ namespace {
   RegisterOpt<DSOpt> X("ds-opt", "DSA-based simple optimizations");
 }
 
-
 /// OptimizeGlobals - This method uses information taken from DSA to optimize
 /// global variables.
 ///
@@ -96,3 +97,5 @@ bool DSOpt::OptimizeGlobals(Module &M) {
     }
   return Changed;
 }
+
+} // End llvm namespace
index 8d2984845a26ca39dbcb25166d92ced2defcb598..3659c906973173446058427f0f4cc637446156ff 100644 (file)
@@ -19,6 +19,8 @@
 #include "Support/Statistic.h"
 #include <vector>
 
+namespace llvm {
+
 namespace {
   Statistic<> TotalNumCallees("totalcallees",
                 "Total number of callee functions at all indirect call sites");
@@ -139,3 +141,5 @@ bool DSGraphStats::runOnFunction(Function& F) {
   visit(F);
   return true;
 }
+
+} // End llvm namespace
index b0164da322ff74b4a91b3331a77a61dacc49b7f3..11ebc6920cb45fa81bce2d312c150da0da0a0bda 100644 (file)
@@ -29,6 +29,8 @@
 #include "llvm/Value.h"
 #include <set>
 
+namespace llvm {
+
 namespace {
   enum DSPass { local, bu, td };
   cl::opt<DSPass>
@@ -193,3 +195,5 @@ void DSGC::verify(const DSGraph &G) {
       }
   }
 }
+
+} // End llvm namespace
index 64b60d48ba29f2a410e8471313a7bb085a1c98b2..01b5bd0023aa38bccee461218c91882bd5911019 100644 (file)
@@ -23,6 +23,8 @@
 #include "Support/StringExtras.h"
 #include <vector>
 
+namespace llvm {
+
 //----------------------------------------------------------------------------
 // Private constants and data
 //----------------------------------------------------------------------------
@@ -441,3 +443,5 @@ void IPModRef::dump() const
 {
   print(std::cerr);
 }
+
+} // End llvm namespace
index 0aca21a437ba90fcbb2aa3b5e1b2fd176b4da06a..253cbf7a3511f216745b84e7251c880040b5d057 100644 (file)
@@ -28,6 +28,8 @@
 //
 #include "llvm/Module.h"
 
+namespace llvm {
+
 static RegisterAnalysis<LocalDataStructures>
 X("datastructure", "Local Data Structure Analysis");
 
@@ -41,8 +43,8 @@ namespace DS {
     return false;
   }
 }
-using namespace DS;
 
+using namespace DS;
 
 namespace {
   cl::opt<bool>
@@ -144,6 +146,8 @@ namespace {
   };
 }
 
+using namespace DS;
+
 //===----------------------------------------------------------------------===//
 // DSGraph constructor - Simply use the GraphBuilder to construct the local
 // graph.
@@ -617,3 +621,5 @@ void LocalDataStructures::releaseMemory() {
   delete GlobalsGraph;
   GlobalsGraph = 0;
 }
+
+} // End llvm namespace
index 076836a5cea50b106ff4a9e301b59460a0fac032..e61c076f3074be38adde8227e1345d22d0bda366 100644 (file)
@@ -31,6 +31,7 @@
 #include "Support/hash_map"
 #include "Support/hash_set"
 
+namespace llvm {
 
 ///--------------------------------------------------------------------------
 /// struct ModRefTable:
@@ -122,7 +123,7 @@ struct ModRefTable {
 class ModRefInfoBuilder : public InstVisitor<ModRefInfoBuilder> {
   const DSGraph&            funcGraph;
   const FunctionModRefInfo& funcModRef;
-  ModRefTable&              modRefTable;
+  struct ModRefTable&       modRefTable;
 
   ModRefInfoBuilder();                         // DO NOT IMPLEMENT
   ModRefInfoBuilder(const ModRefInfoBuilder&); // DO NOT IMPLEMENT
@@ -498,3 +499,5 @@ void MemoryDepAnalysis::dump() const
 static RegisterAnalysis<MemoryDepAnalysis>
 Z("memdep", "Memory Dependence Analysis");
 
+
+} // End llvm namespace
index 77e6ed304080bb96b5089df7758260ea92ccd1ee..fd39b6b12a5e0786f135435df65c25883ca515d7 100644 (file)
@@ -53,6 +53,8 @@
 #include <functional>
 #include <algorithm>
 
+namespace llvm {
+
 //---------------------------------------------------------------------------- 
 // Global constants used in marking Cilk functions and function calls.
 //---------------------------------------------------------------------------- 
@@ -535,3 +537,5 @@ bool Parallelize::run(Module& M)
 
   return true;
 }
+
+} // End llvm namespace
index ef44cb3efbd79dad52ea0f1733512e781a2d49c3..b861c89947815e056adcd45dc5cb529cf27a736c 100644 (file)
@@ -30,6 +30,7 @@
 #include "llvm/Analysis/PostDominators.h"
 #include "llvm/Function.h"
 
+namespace llvm {
 
 //----------------------------------------------------------------------------
 // class DepIterState
@@ -253,3 +254,5 @@ void PgmDependenceGraph::dump() const
 
 static RegisterAnalysis<PgmDependenceGraph>
 Z("pgmdep", "Enumerate Program Dependence Graph (data and control)");
+
+} // End llvm namespace
index 95879795601e35d59540040f16e847a6bc936f4b..9902906e19af14056ad03778d0b291e5b29c9dc0 100644 (file)
@@ -23,6 +23,8 @@
 #include <fstream>
 #include <sstream>
 
+namespace llvm {
+
 // OnlyPrintMain - The DataStructure printer exposes this option to allow
 // printing of only the graph for "main".
 //
@@ -32,7 +34,6 @@ namespace {
   Statistic<> NumFoldedNodes ("dsnode", "Number of folded nodes (in final graph)");
 }
 
-
 void DSNode::dump() const { print(std::cerr, 0); }
 
 static std::string getCaption(const DSNode *N, const DSGraph *G) {
@@ -280,3 +281,5 @@ void BUDataStructures::print(std::ostream &O, const Module *M) const {
 void TDDataStructures::print(std::ostream &O, const Module *M) const {
   printCollection(*this, O, M, "td.");
 }
+
+} // End llvm namespace
index 8bf917f0483dfaf45020b3118656201e83674f0d..d868d250f7bcecab9188d10ce93fcf92202e8741 100644 (file)
@@ -20,6 +20,8 @@
 #include "llvm/Module.h"
 #include "Support/Debug.h"
 
+namespace llvm {
+
 namespace {
   class Steens : public Pass, public AliasAnalysis {
     DSGraph *ResultGraph;
@@ -76,7 +78,6 @@ namespace {
   RegisterAnalysisGroup<AliasAnalysis, Steens> Y;
 }
 
-
 /// ResolveFunctionCall - Resolve the actual arguments of a call to function F
 /// with the specified call site descriptor.  This function links the arguments
 /// and the return value for the call site context-insensitively.
@@ -235,3 +236,5 @@ AliasAnalysis::AliasResult Steens::alias(const Value *V1, unsigned V1Size,
   //
   return getAnalysis<AliasAnalysis>().alias(V1, V1Size, V2, V2Size);
 }
+
+} // End llvm namespace
index ad5a9d7220328182ccaf2115a4df521a778b6e47..696368a866e84ed2a545895828ab29c381350f42 100644 (file)
@@ -21,6 +21,8 @@
 #include "Support/Debug.h"
 #include "Support/Statistic.h"
 
+namespace llvm {
+
 namespace {
   RegisterAnalysis<TDDataStructures>   // Register the pass
   Y("tddatastructure", "Top-down Data Structure Analysis");
@@ -310,3 +312,4 @@ void TDDataStructures::inlineGraphIntoCallees(DSGraph &Graph) {
         << Graph.getFunctionCalls().size() << "]\n");
 }
 
+} // End llvm namespace
index 4d8897e7fffd2d7065328aa90fb49cd8f86183a6..b31639046975b45d8e723d02a33ff67abc5894f5 100644 (file)
@@ -18,6 +18,8 @@
 #include "llvm/ConstantHandling.h"
 #include "llvm/Function.h"
 
+namespace llvm {
+
 ExprType::ExprType(Value *Val) {
   if (Val) 
     if (ConstantInt *CPI = dyn_cast<ConstantInt>(Val)) {
@@ -352,3 +354,5 @@ ExprType ClassifyExpression(Value *Expr) {
   // Otherwise, I don't know anything about this value!
   return I;
 }
+
+} // End llvm namespace
index 8d442420500af8954117f776cce9942d4e0085af..506198c4fa2682a07fd31a33db57d7714060a59c 100644 (file)
@@ -53,6 +53,8 @@
 #include "llvm/Support/CallSite.h"
 #include "Support/STLExtras.h"
 
+namespace llvm {
+
 static RegisterAnalysis<CallGraph> X("callgraph", "Call Graph Construction");
 
 static const char * const KnownExternalFunctions[] = {
@@ -349,3 +351,5 @@ Function *CallGraph::removeFunctionFromModule(CallGraphNode *CGN) {
 }
 
 void CallGraph::stub() {}
+
+} // End llvm namespace
index 74da70131e8e3dbf3aa54ac0607ae7005c100d5b..e9ab6500c8d66016fe1255da7e9a4e25a63495b0 100644 (file)
@@ -19,6 +19,8 @@
 #include "llvm/Analysis/CallGraph.h"
 #include "Support/SCCIterator.h"
 
+namespace llvm {
+
 /// getAnalysisUsage - For this class, we declare that we require and preserve
 /// the call graph.  If the derived class implements this method, it should
 /// always explicitly call the implementation here.
@@ -35,3 +37,5 @@ bool CallGraphSCCPass::run(Module &M) {
     Changed = runOnSCC(*I);
   return Changed;
 }
+
+} // End llvm namespace
index ead777aa1335f75c74fe47969ecf8706d6d87376..7d62ef0350cdb4253865461a53054002b502ef32 100644 (file)
@@ -24,6 +24,7 @@
 #include "llvm/Analysis/DependenceGraph.h"
 #include "llvm/Function.h"
 
+namespace llvm {
 
 //----------------------------------------------------------------------------
 // class Dependence:
@@ -82,3 +83,5 @@ void DependenceGraph::print(const Function& func, std::ostream &O) const
       if (const DepGraphNode* dgNode = this->getNode(*II))
         dgNode->print(O);
 }
+
+} // End llvm namespace
index 7eeff7dbc7ba322515bc77d8a2848e016dbe9524..45f5b72ecf9ab55c5caf1898ea7822da57032553 100644 (file)
@@ -30,6 +30,8 @@
 #include "llvm/Support/InstIterator.h"
 #include "Support/CommandLine.h"
 
+namespace llvm {
+
 static RegisterAnalysis<FindUnsafePointerTypes>
 X("unsafepointertypes", "Find Unsafe Pointer Types");
 
@@ -99,3 +101,5 @@ void FindUnsafePointerTypes::print(std::ostream &o, const Module *M) const {
     CW << " #" << Counter << ". " << (Value*)*I << "\n";
   }
 }
+
+} // End llvm namespace
index 80bf378b5eb5ae717b1a3806715890aa130984eb..e930499e2e28e4e297b166456e8720e779db59f0 100644 (file)
@@ -21,6 +21,8 @@
 #include "llvm/Assembly/CachedWriter.h"
 #include "llvm/Support/InstIterator.h"
 
+namespace llvm {
+
 static RegisterAnalysis<FindUsedTypes>
 X("printusedtypes", "Find Used Types");
 
@@ -106,3 +108,5 @@ void FindUsedTypes::print(std::ostream &o, const Module *M) const {
            E = UsedTypes.end(); I != E; ++I)
       o << "  " << *I << "\n";
 }
+
+} // End llvm namespace
index 64b60d48ba29f2a410e8471313a7bb085a1c98b2..01b5bd0023aa38bccee461218c91882bd5911019 100644 (file)
@@ -23,6 +23,8 @@
 #include "Support/StringExtras.h"
 #include <vector>
 
+namespace llvm {
+
 //----------------------------------------------------------------------------
 // Private constants and data
 //----------------------------------------------------------------------------
@@ -441,3 +443,5 @@ void IPModRef::dump() const
 {
   print(std::cerr);
 }
+
+} // End llvm namespace
index 076836a5cea50b106ff4a9e301b59460a0fac032..e61c076f3074be38adde8227e1345d22d0bda366 100644 (file)
@@ -31,6 +31,7 @@
 #include "Support/hash_map"
 #include "Support/hash_set"
 
+namespace llvm {
 
 ///--------------------------------------------------------------------------
 /// struct ModRefTable:
@@ -122,7 +123,7 @@ struct ModRefTable {
 class ModRefInfoBuilder : public InstVisitor<ModRefInfoBuilder> {
   const DSGraph&            funcGraph;
   const FunctionModRefInfo& funcModRef;
-  ModRefTable&              modRefTable;
+  struct ModRefTable&       modRefTable;
 
   ModRefInfoBuilder();                         // DO NOT IMPLEMENT
   ModRefInfoBuilder(const ModRefInfoBuilder&); // DO NOT IMPLEMENT
@@ -498,3 +499,5 @@ void MemoryDepAnalysis::dump() const
 static RegisterAnalysis<MemoryDepAnalysis>
 Z("memdep", "Memory Dependence Analysis");
 
+
+} // End llvm namespace
index ef44cb3efbd79dad52ea0f1733512e781a2d49c3..b861c89947815e056adcd45dc5cb529cf27a736c 100644 (file)
@@ -30,6 +30,7 @@
 #include "llvm/Analysis/PostDominators.h"
 #include "llvm/Function.h"
 
+namespace llvm {
 
 //----------------------------------------------------------------------------
 // class DepIterState
@@ -253,3 +254,5 @@ void PgmDependenceGraph::dump() const
 
 static RegisterAnalysis<PgmDependenceGraph>
 Z("pgmdep", "Enumerate Program Dependence Graph (data and control)");
+
+} // End llvm namespace
index 345938115871d51c33e3c40d3fa8e4b2cd81a853..ce89fff90e6104a947c38f979b50bbb403cdc64c 100644 (file)
@@ -31,6 +31,8 @@
 #include "llvm/Support/CFG.h"
 #include "Support/SCCIterator.h"
 
+namespace llvm {
+
 namespace {
   struct CFGSCC : public FunctionPass {
     bool runOnFunction(Function& func);
@@ -101,3 +103,5 @@ bool CallGraphSCC::run(Module &M) {
 
   return true;
 }
+
+} // End llvm namespace
index 3119d31ded625585c8589116a5fa8ed562de331e..6e9a209b7e1399ff5e4e56fbf50289ec3bb4f931 100644 (file)
@@ -36,6 +36,8 @@
 #include "llvm/Assembly/Writer.h"
 #include "Support/Debug.h"
 
+namespace llvm {
+
 static bool isLoopInvariant(const Value *V, const Loop *L) {
   if (const Instruction *I = dyn_cast<Instruction>(V))
     return !L->contains(I->getParent());
@@ -299,3 +301,5 @@ void InductionVariable::print(std::ostream &o) const {
   }
   o << "\n";
 }
+
+} // End llvm namespace
index 4d49478a9e62b291a1fcd8f6afad014d39064eb4..9177e4480004704a30f9f85376c0271128f87544 100644 (file)
@@ -16,6 +16,8 @@
 #include "llvm/Support/InstVisitor.h"
 #include "Support/Statistic.h"
 
+namespace llvm {
+
 namespace {
   Statistic<> TotalInsts ("instcount", "Number of instructions (of all types)");
   Statistic<> TotalBlocks("instcount", "Number of basic blocks");
@@ -62,3 +64,5 @@ bool InstCount::runOnFunction(Function &F) {
   visit(F);
   return false;
 }
+
+} // End llvm namespace
index 28cee8363126bf8776d2a95c8776ffaeeb76bd69..8f0bdfa0034733808f18f075fcfd6efc9d80be39 100644 (file)
@@ -17,6 +17,8 @@
 #include "llvm/Support/CFG.h"
 #include <algorithm>
 
+using namespace llvm;
+
 //===----------------------------------------------------------------------===//
 // Interval Implementation
 //===----------------------------------------------------------------------===//
index 27299309984124d8e03e604acf56c29afc99c2a2..12c196f2f70d9e87ad0411762b39de0e3ebd0b6f 100644 (file)
@@ -15,6 +15,8 @@
 #include "llvm/Analysis/IntervalIterator.h"
 #include "Support/STLExtras.h"
 
+namespace llvm {
+
 static RegisterAnalysis<IntervalPartition>
 X("intervals", "Interval Partition Construction", true);
 
@@ -108,3 +110,5 @@ IntervalPartition::IntervalPartition(IntervalPartition &IP, bool) {
   for_each(Intervals.begin(), Intervals.end(), 
           bind_obj(this, &IntervalPartition::updatePredecessors));
 }
+
+} // End llvm namespace
index 68eaebf7d27db6acff761e8c000350177704b6b1..758f1b1539d92968495b5d6a484f00b2bfea0bfa 100644 (file)
@@ -21,6 +21,7 @@
 /// BROKEN: Should not include sparc stuff directly into here
 #include "../../Target/Sparc/SparcInternals.h"  //  Only for PHI defn
 
+namespace llvm {
 
 BBLiveVar::BBLiveVar(const BasicBlock &bb, MachineBasicBlock &mbb, unsigned id)
   : BB(bb), MBB(mbb), POID(id) {
@@ -229,6 +230,4 @@ void BBLiveVar::printInOutSets() const {
   std::cerr << "  Out: ";  printSet(OutSet);  std::cerr << "\n";
 }
 
-
-
-
+} // End llvm namespace
index 33a4faf2b10b591cde6166aa5251864652bb172b..781143a93dfd4c47b930508dfac047bd50b13b23 100644 (file)
@@ -17,6 +17,9 @@
 
 #include "llvm/CodeGen/ValueSet.h"
 #include "Support/hash_map"
+
+namespace llvm {
+
 class BasicBlock;
 class Value;
 class MachineBasicBlock;
@@ -82,4 +85,6 @@ public:
   void printInOutSets() const;    // for printing In/Out sets
 };
 
+} // End llvm namespace
+
 #endif
index 588ec646da766e6d36d97486328e1cd0aae0600b..8f0e31811a9c6fe1a9d479dbb8385a311b4b343c 100644 (file)
@@ -23,6 +23,8 @@
 #include "Support/CommandLine.h"
 #include "BBLiveVar.h"
 
+namespace llvm {
+
 static RegisterAnalysis<FunctionLiveVarInfo>
 X("livevar", "Live Variable Analysis");
 
@@ -318,3 +320,5 @@ void FunctionLiveVarInfo::calcLiveVarSetsForBB(const BasicBlock *BB) {
     SetAI = NewSet;                 
   }
 }
+
+} // End llvm namespace
index ba944cb8cc0a6250edab02b2926eeeada6aeee93..fd8289675a21290ddf8b2e54509a59834513b5e3 100644 (file)
@@ -11,6 +11,8 @@
 #include "llvm/Value.h"
 #include <iostream>
 
+namespace llvm {
+
 std::ostream &operator<<(std::ostream &O, RAV V) { // func to print a Value 
   const Value &v = V.V;
   if (v.hasName())
@@ -26,3 +28,4 @@ void printSet(const ValueSet &S) {
     std::cerr << RAV(*I);
 }
 
+} // End llvm namespace
index cbcdd0f178a467784cce4d9467d957cf117380cb..2d263794175b11f62563fedaa77d0ff6822e2ee5 100644 (file)
@@ -31,6 +31,8 @@
 #include <algorithm>
 #include <set>
 
+namespace llvm {
+
 namespace {
   // FIXME: This should not be a FunctionPass.
   struct LoadVN : public FunctionPass, public ValueNumbering {
@@ -70,8 +72,6 @@ namespace {
   RegisterAnalysisGroup<ValueNumbering, LoadVN> Y;
 }
 
-
-
 Pass *createLoadValueNumberingPass() { return new LoadVN(); }
 
 
@@ -340,3 +340,5 @@ bool LoadVN::haveEqualValueNumber(LoadInst *Load, StoreInst *Store,
     return true;
   }
 }
+
+} // End llvm namespace
index c1f97889e61c54d1b876c145ccd44734711759fd..68e7d2f845daddbde6e1110f0dba4128e1f0ee37 100644 (file)
@@ -21,6 +21,8 @@
 #include "Support/DepthFirstIterator.h"
 #include <algorithm>
 
+namespace llvm {
+
 static RegisterAnalysis<LoopInfo>
 X("loops", "Natural Loop Construction", true);
 
@@ -367,3 +369,5 @@ void Loop::changeExitBlock(BasicBlock *Old, BasicBlock *New) {
     I = std::find(I+1, ExitBlocks.end(), Old);
   }
 }
+
+} // End llvm namespace
index ee31c36b3e33b932742ca20cb140217f829df26b..2589c8577396e41182a3df673730e71f0cfd29be 100644 (file)
@@ -17,6 +17,8 @@
 #include "Support/DepthFirstIterator.h"
 #include "Support/SetOperations.h"
 
+namespace llvm {
+
 //===----------------------------------------------------------------------===//
 //  PostDominatorSet Implementation
 //===----------------------------------------------------------------------===//
@@ -214,3 +216,5 @@ PostDominanceFrontier::calculate(const PostDominatorTree &DT,
 // stub - a dummy function to make linking work ok.
 void PostDominanceFrontier::stub() {
 }
+
+} // End llvm namespace
index 345938115871d51c33e3c40d3fa8e4b2cd81a853..ce89fff90e6104a947c38f979b50bbb403cdc64c 100644 (file)
@@ -31,6 +31,8 @@
 #include "llvm/Support/CFG.h"
 #include "Support/SCCIterator.h"
 
+namespace llvm {
+
 namespace {
   struct CFGSCC : public FunctionPass {
     bool runOnFunction(Function& func);
@@ -101,3 +103,5 @@ bool CallGraphSCC::run(Module &M) {
 
   return true;
 }
+
+} // End llvm namespace
index 075c1c2b3f8da9d5ffd6b806321234356ee7f7b3..191e190e20e118905cf244cac5a821f9a5cc4309 100644 (file)
@@ -19,6 +19,8 @@
 #include "llvm/Type.h"
 #include "llvm/iMemory.h"
 
+namespace llvm {
+
 // Register the ValueNumbering interface, providing a nice name to refer to.
 static RegisterAnalysisGroup<ValueNumbering> X("Value Numbering");
 
@@ -39,6 +41,7 @@ ValueNumbering::~ValueNumbering() {}
 // into the tool that uses it.  As such, we register and implement the class
 // here.
 //
+
 namespace {
   /// BasicVN - This class is the default implementation of the ValueNumbering
   /// interface.  It walks the SSA def-use chains to trivially identify
@@ -62,9 +65,7 @@ namespace {
 
   // Declare that we implement the ValueNumbering interface
   RegisterAnalysisGroup<ValueNumbering, BasicVN, true> Y;
-}  // End of anonymous namespace
 
-namespace {
   /// BVNImpl - Implement BasicVN in terms of a visitor class that
   /// handles the different types of instructions as appropriate.
   ///
@@ -190,3 +191,5 @@ void BVNImpl::visitGetElementPtrInst(GetElementPtrInst &I) {
         RetVals.push_back(Other);
       }
 }
+
+} // End llvm namespace
index d155b69beeca82f2f29fb87b91eb6a2f53f66000..33ae24b60ea3346bd9846a8a6a19282e3145e892 100644 (file)
@@ -22,6 +22,8 @@
 #include "Config/sys/mman.h"
 #include "Config/fcntl.h"
 
+namespace llvm {
+
 namespace {
   struct ar_hdr {
     char name[16];
@@ -40,7 +42,6 @@ namespace {
   };
 }
 
-
 // getObjectType - Determine the type of object that this header represents.
 // This is capable of parsing the variety of special sections used for various
 // purposes.
@@ -173,3 +174,5 @@ bool ReadArchiveFile(const std::string &Filename, std::vector<Module*> &Objects,
   
   return Result;
 }
+
+} // End llvm namespace
index 6466cb721b760748162442ffa8972d70c281461f..b0e174af50f930ac632688883efcc2880c1bd638 100644 (file)
@@ -35,6 +35,7 @@
 #define RET_TOK(type, Enum, sym) \
   llvmAsmlval.type = Instruction::Enum; return sym
 
+namespace llvm {
 
 // TODO: All of the static identifiers are figured out by the lexer, 
 // these should be hashed to reduce the lexer size
@@ -121,6 +122,10 @@ char *UnEscapeLexed(char *Buffer, bool AllowNull) {
   return BOut;
 }
 
+} // End llvm namespace
+
+using namespace llvm;
+
 #define YY_NEVER_INTERACTIVE 1
 %}
 
index e8a7bdbbb9896010066edbd28052b88f6e446758..2d6185efeb03384bbb82ce5c4b3a992f4ff1b411 100644 (file)
@@ -15,6 +15,8 @@
 #include "llvm/Module.h"
 #include "llvm/Analysis/Verifier.h"
 
+namespace llvm {
+
 // The useful interface defined by this file... Parse an ASCII file, and return
 // the internal representation in a nice slice'n'dice'able representation.
 //
@@ -82,3 +84,5 @@ const std::string ParseException::getMessage() const {
   
   return Result + ": " + Message;
 }
+
+} // End llvm namespace
index c7837959e61d0a25c6b92743014b38add094bad0..c18434d1f0767683e8d19ea25cf0e7eaec4f8db8 100644 (file)
 #include "llvm/Assembly/Parser.h"
 #include "Support/StringExtras.h"
 
-class Module;
-
 // Global variables exported from the lexer...
 extern std::FILE *llvmAsmin;
 extern int llvmAsmlineno;
 
+// Globals exported by the parser...
+extern char* llvmAsmtext;
+extern int   llvmAsmleng;
+
+namespace llvm {
+
 // Globals exported by the parser...
 extern std::string CurFilename;
+
+class Module;
 Module *RunVMAsmParser(const std::string &Filename, FILE *F);
 
-extern char* llvmAsmtext;
-extern int   llvmAsmleng;
 
 // UnEscapeLexed - Run through the specified buffer and change \xx codes to the
 // appropriate character.  If AllowNull is set to false, a \00 value will cause
@@ -209,4 +213,6 @@ static inline int getLineNumFromPlaceHolder(const Value *Val) {
   }
 }
 
+} // End llvm namespace
+
 #endif
index 96d2daeec4b3322837a71db717546c6a3179eb64..a55e735ca493f57b1d52a3ef83566c4c7affff6f 100644 (file)
@@ -29,6 +29,8 @@ int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit
 int yylex();                       // declaration" of xxx warnings.
 int yyparse();
 
+namespace llvm {
+
 static Module *ParserResult;
 std::string CurFilename;
 
@@ -686,30 +688,34 @@ Module *RunVMAsmParser(const std::string &Filename, FILE *F) {
   return Result;
 }
 
+} // End llvm namespace
+
+using namespace llvm;
+
 %}
 
 %union {
-  Module                           *ModuleVal;
-  Function                         *FunctionVal;
-  std::pair<PATypeHolder*, char*>  *ArgVal;
-  BasicBlock                       *BasicBlockVal;
-  TerminatorInst                   *TermInstVal;
-  Instruction                      *InstVal;
-  Constant                         *ConstVal;
-
-  const Type                       *PrimType;
-  PATypeHolder                     *TypeVal;
-  Value                            *ValueVal;
-
-  std::vector<std::pair<PATypeHolder*,char*> > *ArgList;
-  std::vector<Value*>              *ValueList;
-  std::list<PATypeHolder>          *TypeList;
-  std::list<std::pair<Value*,
-                      BasicBlock*> > *PHIList; // Represent the RHS of PHI node
-  std::vector<std::pair<Constant*, BasicBlock*> > *JumpTable;
-  std::vector<Constant*>           *ConstVector;
-
-  GlobalValue::LinkageTypes         Linkage;
+  llvm::Module                           *ModuleVal;
+  llvm::Function                         *FunctionVal;
+  std::pair<llvm::PATypeHolder*, char*>  *ArgVal;
+  llvm::BasicBlock                       *BasicBlockVal;
+  llvm::TerminatorInst                   *TermInstVal;
+  llvm::Instruction                      *InstVal;
+  llvm::Constant                         *ConstVal;
+
+  const llvm::Type                       *PrimType;
+  llvm::PATypeHolder                     *TypeVal;
+  llvm::Value                            *ValueVal;
+
+  std::vector<std::pair<llvm::PATypeHolder*,char*> > *ArgList;
+  std::vector<llvm::Value*>              *ValueList;
+  std::list<llvm::PATypeHolder>          *TypeList;
+  std::list<std::pair<llvm::Value*,
+                      llvm::BasicBlock*> > *PHIList; // Represent the RHS of PHI node
+  std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
+  std::vector<llvm::Constant*>           *ConstVector;
+
+  llvm::GlobalValue::LinkageTypes         Linkage;
   int64_t                           SInt64Val;
   uint64_t                          UInt64Val;
   int                               SIntVal;
@@ -718,13 +724,13 @@ Module *RunVMAsmParser(const std::string &Filename, FILE *F) {
   bool                              BoolVal;
 
   char                             *StrVal;   // This memory is strdup'd!
-  ValID                             ValIDVal; // strdup'd memory maybe!
+  llvm::ValID                             ValIDVal; // strdup'd memory maybe!
 
-  Instruction::BinaryOps            BinaryOpVal;
-  Instruction::TermOps              TermOpVal;
-  Instruction::MemoryOps            MemOpVal;
-  Instruction::OtherOps             OtherOpVal;
-  Module::Endianness                Endianness;
+  llvm::Instruction::BinaryOps            BinaryOpVal;
+  llvm::Instruction::TermOps              TermOpVal;
+  llvm::Instruction::MemoryOps            MemOpVal;
+  llvm::Instruction::OtherOps             OtherOpVal;
+  llvm::Module::Endianness                Endianness;
 }
 
 %type <ModuleVal>     Module FunctionList
@@ -1892,6 +1898,7 @@ MemoryInst : MALLOC Types {
     delete $2; delete $4;
   };
 
+
 %%
 int yyerror(const char *ErrorMsg) {
   std::string where 
index d155b69beeca82f2f29fb87b91eb6a2f53f66000..33ae24b60ea3346bd9846a8a6a19282e3145e892 100644 (file)
@@ -22,6 +22,8 @@
 #include "Config/sys/mman.h"
 #include "Config/fcntl.h"
 
+namespace llvm {
+
 namespace {
   struct ar_hdr {
     char name[16];
@@ -40,7 +42,6 @@ namespace {
   };
 }
 
-
 // getObjectType - Determine the type of object that this header represents.
 // This is capable of parsing the variety of special sections used for various
 // purposes.
@@ -173,3 +174,5 @@ bool ReadArchiveFile(const std::string &Filename, std::vector<Module*> &Objects,
   
   return Result;
 }
+
+} // End llvm namespace
index d155b69beeca82f2f29fb87b91eb6a2f53f66000..33ae24b60ea3346bd9846a8a6a19282e3145e892 100644 (file)
@@ -22,6 +22,8 @@
 #include "Config/sys/mman.h"
 #include "Config/fcntl.h"
 
+namespace llvm {
+
 namespace {
   struct ar_hdr {
     char name[16];
@@ -40,7 +42,6 @@ namespace {
   };
 }
 
-
 // getObjectType - Determine the type of object that this header represents.
 // This is capable of parsing the variety of special sections used for various
 // purposes.
@@ -173,3 +174,5 @@ bool ReadArchiveFile(const std::string &Filename, std::vector<Module*> &Objects,
   
   return Result;
 }
+
+} // End llvm namespace
index 00f44b3665e0997e7b45db2b123880d70929ed8b..b4553548e8eec15050dbf98fc4629ad6e519124c 100644 (file)
@@ -20,6 +20,8 @@
 #include "llvm/Constants.h"
 #include <algorithm>
 
+namespace llvm {
+
 const Type *BytecodeParser::parseTypeConstant(const unsigned char *&Buf,
                                              const unsigned char *EndBuf) {
   unsigned PrimType;
@@ -356,3 +358,5 @@ void BytecodeParser::ParseConstantPool(const unsigned char *&Buf,
   
   if (Buf > EndBuf) throw std::string("Read past end of buffer.");
 }
+
+} // End llvm namespace
index a409ceebef975f2e384a003f1e569529382760c5..ec8944e7a87f5413b8c44c47b163a3cfe59b52a0 100644 (file)
@@ -22,6 +22,8 @@
 #include "llvm/iOther.h"
 #include "llvm/Module.h"
 
+namespace llvm {
+
 namespace {
   struct RawInst {       // The raw fields out of the bytecode stream...
     unsigned NumOperands;
@@ -33,8 +35,6 @@ namespace {
   };
 }
 
-
-
 RawInst::RawInst(const unsigned char *&Buf, const unsigned char *EndBuf,
                  std::vector<unsigned> &Args) {
   unsigned Op, Typ;
@@ -389,3 +389,5 @@ void BytecodeParser::ParseInstruction(const unsigned char *&Buf,
   BB->getInstList().push_back(Result);
   BCR_TRACE(4, *Result);
 }
+
+} // End llvm namespace
index a36ea7a7348bc2b87e92ae82433bc5dfb6436164..9acb93d48a6658182b97e5a033da6cc366e72dff 100644 (file)
@@ -32,6 +32,8 @@
 #include <algorithm>
 #include <memory>
 
+namespace llvm {
+
 static inline void ALIGN32(const unsigned char *&begin,
                            const unsigned char *end) {
   if (align32(begin, end))
@@ -693,3 +695,5 @@ void BytecodeParser::ParseBytecode(const unsigned char *Buf, unsigned Length,
     throw;
   }
 }
+
+} // End llvm namespace
index c8905454e670c39745f97da37bd6445b0d38e961..81ccde97fff2501b418874a9c4e072394c490a28 100644 (file)
@@ -22,6 +22,8 @@
 #include <utility>
 #include <map>
 
+namespace llvm {
+
 // Enable to trace to figure out what the heck is going on when parsing fails
 //#define TRACE_LEVEL 10
 //#define DEBUG_OUTPUT
@@ -226,4 +228,6 @@ static inline void readBlock(const unsigned char *&Buf,
 #endif
 }
 
+} // End llvm namespace
+
 #endif
index 0df6ea5ff23788557c68f548735225b4d819d2a6..1cbead02e85d3c2202de46563d20ce609211bf73 100644 (file)
@@ -21,6 +21,8 @@
 #include "Config/unistd.h"
 #include "Config/sys/mman.h"
 
+namespace llvm {
+
 //===----------------------------------------------------------------------===//
 // BytecodeFileReader - Read from an mmap'able file descriptor.
 //
@@ -163,7 +165,7 @@ BytecodeStdinReader::BytecodeStdinReader() {
   unsigned char Buffer[4096*4];
 
   // Read in all of the data from stdin, we cannot mmap stdin...
-  while ((BlockSize = read(0 /*stdin*/, Buffer, 4096*4))) {
+  while ((BlockSize = ::read(0 /*stdin*/, Buffer, 4096*4))) {
     if (BlockSize == -1)
       throw std::string("Error reading from stdin!");
     
@@ -249,7 +251,6 @@ static ModuleProvider *CheckVarargs(ModuleProvider *MP) {
   return MP;
 }
 
-
 //===----------------------------------------------------------------------===//
 // Wrapper functions
 //===----------------------------------------------------------------------===//
@@ -296,3 +297,5 @@ Module *ParseBytecodeFile(const std::string &Filename, std::string *ErrorStr) {
     return 0;
   }
 }
+
+} // End llvm namespace
index a9aaffe3ecad35aa2189e1486fc8705339af58c8..303672d166f664511583cdf1f83ffd8280da8b96 100644 (file)
@@ -17,6 +17,8 @@
 #include "llvm/SymbolTable.h"
 #include "llvm/DerivedTypes.h"
 
+namespace llvm {
+
 void BytecodeWriter::outputType(const Type *T) {
   output_vbr((unsigned)T->getPrimitiveID(), Out);
   
@@ -202,3 +204,5 @@ bool BytecodeWriter::outputConstant(const Constant *CPV) {
   }
   return false;
 }
+
+} // End llvm namespace
index faa576ecb46592e02501f403b8f66045eee41cd4..d52f24145f4448bbc4253a7f06292e59e9b7dee4 100644 (file)
@@ -19,6 +19,8 @@
 #include "Support/Statistic.h"
 #include <algorithm>
 
+namespace llvm {
+
 static Statistic<> 
 NumInstrs("bytecodewriter", "Number of instructions");
 
@@ -295,3 +297,5 @@ void BytecodeWriter::processInstruction(const Instruction &I) {
   // operands or a large operand index that we are referring to.
   outputInstructionFormat0(&I, Opcode, Table, Type, Out);
 }
+
+} // End llvm namespace
index aef71763c44dd7f4ab82ccca5325235fb79dc73d..c6e44e8266f35d07c3710a72a8412a43d1498ad8 100644 (file)
@@ -27,6 +27,8 @@
 #include "Support/STLExtras.h"
 #include <algorithm>
 
+namespace llvm {
+
 #if 0
 #define SC_DEBUG(X) std::cerr << X
 #else
@@ -361,3 +363,5 @@ int SlotCalculator::doInsertValue(const Value *D) {
   SC_DEBUG("]\n");
   return (int)DestSlot;
 }
+
+} // End llvm namespace
index 7e56de99dca72207fa1b2f60e6117cd6e8ac0c61..596f9324edbae88012850f7b3f8444b6766d3701 100644 (file)
@@ -22,6 +22,9 @@
 
 #include <vector>
 #include <map>
+
+namespace llvm {
+
 class Value;
 class Module;
 class Function;
@@ -92,4 +95,6 @@ protected:
   void processSymbolTableConstants(const SymbolTable *ST);
 };
 
+} // End llvm namespace
+
 #endif
index 9381e355f0e3cca3ec75efd2c2161332ff60ca65..9c9e1abcdd82576bc6cba12e109d0d809d84056c 100644 (file)
@@ -36,6 +36,8 @@
 #include "Config/string.h"
 #include <algorithm>
 
+namespace llvm {
+
 static RegisterPass<WriteBytecodePass> X("emitbytecode", "Bytecode Writer");
 
 static Statistic<> 
@@ -304,3 +306,5 @@ void WriteBytecodeToFile(const Module *C, std::ostream &Out) {
 
   Out.flush();
 }
+
+} // End llvm namespace
index 5564f4238ec7309cedec0690d7b324309e2fe5b2..8cb4bfd8d6cea47e2033a4e607e41d49e499f475 100644 (file)
@@ -25,6 +25,8 @@
 #include "llvm/SlotCalculator.h"
 #include "llvm/Instruction.h"
 
+namespace llvm {
+
 class BytecodeWriter {
   std::deque<unsigned char> &Out;
   SlotCalculator Table;
@@ -79,5 +81,6 @@ public:
   }
 };
 
+} // End llvm namespace
 
 #endif
index a50439de7f66fe5d236c1d038ffe8d480b01c6e6..4e2bf4787632697984c31df772de4e7dccce06bd 100644 (file)
@@ -22,6 +22,8 @@
 #include "Support/CommandLine.h"
 #include <algorithm>
 
+namespace llvm {
+
 SchedDebugLevel_t SchedDebugLevel;
 
 static cl::opt<bool> EnableFillingDelaySlots("sched-fill-delay-slots",
@@ -1518,3 +1520,6 @@ bool InstructionSchedulingWithSSA::runOnFunction(Function &F)
 FunctionPass *createInstructionSchedulingWithSSAPass(const TargetMachine &tgt) {
   return new InstructionSchedulingWithSSA(tgt);
 }
+
+} // End llvm namespace
+
index e7cd47881ac135858b45b688a95b65b15b5e01cc..3a8088043bf75f0346ccb1ce560d44b22dd9e80f 100644 (file)
@@ -23,6 +23,8 @@
 #include "llvm/Target/TargetRegInfo.h"
 #include "Support/STLExtras.h"
 
+namespace llvm {
+
 //*********************** Internal Data Structures *************************/
 
 // The following two types need to be classes, not typedefs, so we can use
@@ -737,3 +739,5 @@ void SchedGraphNode::print(std::ostream &os) const {
       os << std::string(16, ' ') << *outEdges[i];
   }
 }
+
+} // End llvm namespace
index 50cc0520e6f35f1c834d391e67e83cded00e7e46..5aee9b25f6939f0817baa4c0d6eccee680f480d0 100644 (file)
@@ -25,6 +25,8 @@
 #include "Support/hash_map"
 #include "Support/GraphTraits.h"
 
+namespace llvm {
+
 class RegToRefVecMap;
 class ValueToDefVecMap;
 class RefVec;
@@ -317,4 +319,6 @@ template <> struct GraphTraits<const SchedGraph*> {
   }
 };
 
+} // End llvm namespace
+
 #endif
index b75e3397cb99ad7b6198a9c2582bcf9bf06a60f0..d96c201c8a2cf3c717a56aaa89a3e17c4a697f53 100644 (file)
@@ -15,6 +15,8 @@
 #include "llvm/CodeGen/SchedGraphCommon.h"
 #include "Support/STLExtras.h"
 
+namespace llvm {
+
 class SchedGraphCommon;
 
 //
@@ -175,3 +177,4 @@ void SchedGraphCommon::eraseIncidentEdges(SchedGraphNodeCommon* node,
   this->eraseOutgoingEdges(node, addDummyEdges);       
 }
 
+} // End llvm namespace
index 1644d5ecbc58a96dcf55af9a39768c8492a59459..7e05d1417fde67dc47025359fbc9942861c5642f 100644 (file)
@@ -23,6 +23,8 @@
 #include "llvm/Support/CFG.h"
 #include "Support/PostOrderIterator.h"
 
+namespace llvm {
+
 std::ostream &operator<<(std::ostream &os, const NodeDelayPair* nd) {
   return os << "Delay for node " << nd->node->getNodeId()
            << " = " << (long)nd->delay << "\n";
@@ -278,3 +280,4 @@ SchedPriorities::instructionHasLastUse(FunctionLiveVarInfo &LVI,
   return lastUseMap[MI] = hasLastUse;
 }
 
+} // End llvm namespace
index de321f9fcbf6d3cd2efe7b28052bac7392c5cd67..74704678066088137f9fc3b9e72e0e9c2774d313 100644 (file)
@@ -26,6 +26,8 @@
 #include "Support/hash_set"
 #include <list>
 
+namespace llvm {
+
 class Function;
 class MachineInstr;
 class SchedulingManager;
@@ -214,4 +216,6 @@ inline void SchedPriorities::updateTime(cycles_t c) {
 
 std::ostream &operator<<(std::ostream &os, const NodeDelayPair* nd);
 
+} // End llvm namespace
+
 #endif
index 5496502d5efd6be78b058ef74a507426981eb28f..fd5056d22d7bd6a0fdc94300c620a713690ceceb 100644 (file)
@@ -30,6 +30,8 @@
 #include "Support/STLExtras.h"
 #include "Config/alloca.h"
 
+namespace llvm {
+
 //------------------------------------------------------------------------ 
 // class InstrTreeNode
 //------------------------------------------------------------------------ 
@@ -330,3 +332,5 @@ InstructionNode* InstrForest::buildTreeForInstruction(Instruction *instr) {
   delete [] childArray;
   return treeNode;
 }
+
+} // End llvm namespace
index 0e3e2cdbf25cc6af15c6cfee7519f609b70ad000..760976509c156f325e3ab58d40181ab11042f827 100644 (file)
@@ -28,6 +28,8 @@
 #include "Support/LeakDetector.h"
 #include <vector>
 
+namespace llvm {
+
 std::vector<MachineInstr*>
 FixConstantOperandsForInstr(Instruction* vmInstr, MachineInstr* minstr,
                             TargetMachine& target);
@@ -82,6 +84,8 @@ namespace {
   };
 }
 
+namespace llvm {
+
 TmpInstruction::TmpInstruction(MachineCodeForInstruction& mcfi,
                                Value *s1, Value *s2, const std::string &name)
   : Instruction(s1->getType(), Instruction::UserOp1, name)
@@ -114,6 +118,7 @@ TmpInstruction::TmpInstruction(MachineCodeForInstruction& mcfi,
   LeakDetector::removeGarbageObject(this);
 }
 
+} // End llvm namespace
 
 bool InstructionSelection::runOnFunction(Function &F)
 {
@@ -375,7 +380,6 @@ InstructionSelection::PostprocessMachineCodeForTree(InstructionNode* instrNode,
 }
 
 
-
 //===----------------------------------------------------------------------===//
 // createInstructionSelectionPass - Public entrypoint for instruction selection
 // and this file as a whole...
@@ -383,3 +387,5 @@ InstructionSelection::PostprocessMachineCodeForTree(InstructionNode* instrNode,
 FunctionPass *createInstructionSelectionPass(TargetMachine &T) {
   return new InstructionSelection(T);
 }
+
+} // End llvm namespace
index 93f7618641551a1595bb12ae796efbb00eb33c3c..44a43596ee3bc1b57a3454e7df90e15b804c6227 100644 (file)
@@ -25,6 +25,7 @@
 #include "llvm/DerivedTypes.h"
 #include "../../Target/Sparc/SparcInstrSelectionSupport.h"  // FIXME!
 
+namespace llvm {
 
 // Generate code to load the constant into a TmpInstruction (virtual reg) and
 // returns the virtual register.
@@ -257,3 +258,5 @@ FixConstantOperandsForInstr(Instruction* vmInstr,
   
   return MVec;
 }
+
+} // End llvm namespace
index 50b90b1fdcd2f76539b9ada2acbada3e3eb055de..7ec4d32c1e88742f427afa364a3db0a80d1af1dc 100644 (file)
@@ -33,6 +33,8 @@
 #include "llvm/Support/CFG.h"
 #include "Support/DepthFirstIterator.h"
 
+namespace llvm {
+
 static RegisterAnalysis<LiveVariables> X("livevars", "Live Variable Analysis");
 
 const std::pair<MachineBasicBlock*, unsigned> &
@@ -307,3 +309,5 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &MF) {
   
   return false;
 }
+
+} // End llvm namespace
index 6e56594a10d5abf0a2c000832b6555684530893b..d9b1f7ce450ce3e60baceacaa395959f927f5496 100644 (file)
@@ -16,6 +16,8 @@
 #include "llvm/Function.h"
 #include <fstream>
 
+namespace llvm {
+
 namespace {
   struct DebugMachineCodeEmitter : public MachineCodeEmitter {
     void startFunction(MachineFunction &F) {
@@ -54,18 +56,7 @@ namespace {
       return 0;
     }
   };
-}
-
-
-/// createDebugMachineCodeEmitter - Return a dynamically allocated machine
-/// code emitter, which just prints the opcodes and fields out the cout.  This
-/// can be used for debugging users of the MachineCodeEmitter interface.
-///
-MachineCodeEmitter *MachineCodeEmitter::createDebugEmitter() {
-  return new DebugMachineCodeEmitter();
-}
 
-namespace {
   class FilePrinterEmitter : public MachineCodeEmitter {
     std::ofstream actual;
     std::ostream &o;
@@ -169,7 +160,18 @@ namespace {
   };
 }
 
+/// createDebugMachineCodeEmitter - Return a dynamically allocated machine
+/// code emitter, which just prints the opcodes and fields out the cout.  This
+/// can be used for debugging users of the MachineCodeEmitter interface.
+///
+MachineCodeEmitter *
+MachineCodeEmitter::createDebugEmitter() {
+  return new DebugMachineCodeEmitter();
+}
+
 MachineCodeEmitter *
 MachineCodeEmitter::createFilePrinterEmitter(MachineCodeEmitter &MCE) {
   return new FilePrinterEmitter(MCE, std::cerr);
 }
+
+} // End llvm namespace
index 36bafe2ff96e2a98ddb26b88526df2f32c8ea7cc..000f3d175b88476bc15ee45b45eff3edc59f446e 100644 (file)
@@ -27,6 +27,8 @@
 #include "llvm/CodeGen/MachineInstrAnnot.h"
 #include "llvm/CodeGen/InstrSelection.h"
 
+namespace llvm {
+
 AnnotationID MCFI_AID(
              AnnotationManager::getID("CodeGen::MachineCodeForInstruction"));
 
@@ -68,3 +70,5 @@ MachineCodeForInstruction::~MachineCodeForInstruction()
   if (callArgsDesc)
     delete callArgsDesc;
 }
+
+} // End llvm namespace
index c1eb30a1966aeb7641aa6cf23e8842299047f303..790859bc87a295323537cceab7caac9e68284319 100644 (file)
@@ -28,6 +28,8 @@
 #include "llvm/Pass.h"
 #include "Config/limits.h"
 
+namespace llvm {
+
 const int INVALID_FRAME_OFFSET = INT_MAX; // std::numeric_limits<int>::max();
 
 static AnnotationID MF_AID(
@@ -414,3 +416,5 @@ MachineFunctionInfo::getOffset(const Value* val) const
   hash_map<const Value*, int>::const_iterator pair = offsets.find(val);
   return (pair == offsets.end()) ? INVALID_FRAME_OFFSET : pair->second;
 }
+
+} // End llvm namespace
index 7fb8b4569e27308d9ae1e5a5fff4587846551780..ef31cc4cb3fdc3912c8cfef7ee20d0b2312722f9 100644 (file)
@@ -16,6 +16,8 @@
 #include "llvm/Target/TargetInstrInfo.h"
 #include "llvm/Target/MRegisterInfo.h"
 
+namespace llvm {
+
 // Global variable holding an array of descriptors for machine instructions.
 // The actual object needs to be created separately for each target machine.
 // This variable is initialized and reset by class TargetInstrInfo.
@@ -289,7 +291,7 @@ void MachineInstr::print(std::ostream &OS, const TargetMachine &TM) const {
    // Specialize printing if op#0 is definition
   if (getNumOperands() &&
       (getOperand(0).opIsDefOnly() || getOperand(0).opIsDefAndUse())) {
-    ::print(getOperand(0), OS, TM);
+      llvm::print(getOperand(0), OS, TM);
     OS << " = ";
     ++StartOp;   // Don't print this operand again!
   }
@@ -300,7 +302,7 @@ void MachineInstr::print(std::ostream &OS, const TargetMachine &TM) const {
     if (i != StartOp)
       OS << ",";
     OS << " ";
-    ::print(mop, OS, TM);
+    llvm::print(mop, OS, TM);
     
     if (mop.opIsDefAndUse())
       OS << "<def&use>";
@@ -433,3 +435,5 @@ std::ostream &operator<<(std::ostream &OS, const MachineOperand &MO)
   
   return OS;
 }
+
+} // End llvm namespace
index bf4e68e112fd2bbf07033ec5788c008a4781fb5f..b4b41ac1761b211f3e6b149d3cfbfa3c24ae2e4d 100644 (file)
@@ -18,6 +18,7 @@
 #include "llvm/iOther.h"
 #include "llvm/Type.h"
 
+namespace llvm {
 
 CallArgsDescriptor::CallArgsDescriptor(CallInst* _callInstr,
                                        TmpInstruction* _retAddrReg,
@@ -76,3 +77,5 @@ CallArgsDescriptor *CallArgsDescriptor::get(const MachineInstr* MI)
   assert(desc->getCallInst()==callInstr && "Incorrect call args descriptor?");
   return desc;
 }
+
+} // End llvm namespace
index 6318c5ab46f3e9db8222cf0e42e0ae0eff2bf7cf..8aaaa2b6b5cfce483700abb63fa71230d15b3532 100644 (file)
@@ -13,6 +13,8 @@
 #include "ModuloSchedGraph.h"
 #include "llvm/Type.h"
 
+namespace llvm {
+
 ModuloSchedGraphNode::ModuloSchedGraphNode(unsigned id, int index, 
                                           const Instruction *inst, 
                                           const TargetMachine &targ) 
@@ -135,3 +137,4 @@ ModuloSchedGraphSet::~ModuloSchedGraphSet(){
   //delete all the graphs
 }
 
+} // End llvm namespace
index 214e24cc8b5eca5c122ced03a0790347bb9a2653..552d699e768f8d8ef5debadacb7ffdf994bf78a9 100644 (file)
@@ -22,6 +22,7 @@
 #include "Support/hash_map"
 #include <vector>
 
+namespace llvm {
 
 class ModuloSchedGraphNode : public SchedGraphNodeCommon {
 
@@ -106,4 +107,6 @@ public:
 
 };
 
+} // End llvm namespace
+
 #endif
index 91ec6c28f55262d154632783a66625ecb6163c90..219d892d3143397bf117c62fb8fc00264405c6b0 100644 (file)
@@ -16,6 +16,8 @@
 #include "llvm/Function.h"
 #include "llvm/Pass.h"
 
+namespace llvm {
+
 namespace {
   
   class ModuloScheduling : public FunctionPass {
@@ -40,3 +42,5 @@ bool ModuloScheduling::runOnFunction(Function &F) {
   bool Changed = false;
   return Changed;
 }
+
+} // End llvm namespace
index 5a988bafe3c87c1fbfe689522ba3b6b7d3f2d87a..c4b811aef6b855e4c01fc4eabec2b408c66a713c 100644 (file)
@@ -21,6 +21,8 @@
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Support/CFG.h"
 
+namespace llvm {
+
 namespace {
   struct PNE : public MachineFunctionPass {
     bool runOnMachineFunction(MachineFunction &Fn) {
@@ -52,6 +54,7 @@ namespace {
                      "Eliminate PHI nodes for register allocation");
 }
 
+
 const PassInfo *PHIEliminationID = X.getPassInfo();
 
 /// EliminatePHINodes - Eliminate phi nodes by inserting copy instructions in
@@ -260,3 +263,5 @@ bool PNE::EliminatePHINodes(MachineFunction &MF, MachineBasicBlock &MBB) {
 
   return true;
 }
+
+} // End llvm namespace
index 7a51a53ad894182b993c98db4cb018da3df9a869..239eacde4c146da14c8f46f3b764f1e296b98747 100644 (file)
@@ -15,6 +15,8 @@
 #include "llvm/CodeGen/Passes.h"
 #include "Support/CommandLine.h"
 
+namespace llvm {
+
 namespace {
   enum RegAllocName { simple, local };
 
@@ -40,3 +42,5 @@ FunctionPass *createRegisterAllocator()
     return 0; // not reached
   }
 }
+
+} // End llvm namespace
index a60b8b127bf8ddf9efa516a735a08dc573677769..8fc9b5b2c2172e241d0711132ebe21ec9ff1f770 100644 (file)
@@ -25,6 +25,8 @@
 #include "llvm/Target/TargetFrameInfo.h"
 #include "llvm/Target/TargetInstrInfo.h"
 
+namespace llvm {
+
 namespace {
   struct PEI : public MachineFunctionPass {
     const char *getPassName() const {
@@ -66,6 +68,7 @@ namespace {
   };
 }
 
+
 /// createPrologEpilogCodeInserter - This function returns a pass that inserts
 /// prolog and epilog code, and eliminates abstract frame references.
 ///
@@ -258,3 +261,5 @@ void PEI::replaceFrameIndices(MachineFunction &Fn) {
          break;
        }
 }
+
+} // End llvm namespace
index f83f2103be7fbd43a5997c0d1da87f52364e3322..67f58a7ed04bc58127470aa69a5a7d39dc7e15a8 100644 (file)
@@ -19,6 +19,8 @@
 #include "llvm/DerivedTypes.h"
 #include "llvm/Constants.h"
 
+namespace llvm {
+
 /// AllocInfo - Structure representing one instruction's operand's-worth of
 /// register allocation state. We create tables made out of these data
 /// structures to generate mapping information for this register allocator.
@@ -77,4 +79,6 @@ struct AllocInfo {
   }
 };
 
+} // End llvm namespace
+
 #endif // ALLOCINFO_H
index f883fb13c1d211338fd4dc5dd8ae49d4bb672b69..a76fdeaa037009411f9a2344ccf4d5ae07908c92 100644 (file)
@@ -16,6 +16,8 @@
 #include <algorithm>
 #include <iostream>
 
+namespace llvm {
+
 //-----------------------------------------------------------------------------
 // Sets this IGNode on stack and reduce the degree of neighbors  
 //-----------------------------------------------------------------------------
@@ -56,3 +58,5 @@ IGNode::getCombinedDegree(const IGNode* otherNode) const {
   std::vector<IGNode*>::iterator new_end = unique(nbrs.begin(), nbrs.end());
   return new_end - nbrs.begin();
 }
+
+} // End llvm namespace
index 82f07e0c7e7449028f8f0650e2945a1c4cdae859..9fdc7a6ac07e84aef9aa5e9da986d458e653ca66 100644 (file)
@@ -32,6 +32,9 @@
 
 #include "LiveRange.h"
 #include <vector>
+
+namespace llvm {
+
 class RegClass;
 
 //----------------------------------------------------------------------------
@@ -115,4 +118,6 @@ public:
   inline LiveRange *getParentLR() const { return ParentLR; }
 };
 
+} // End llvm namespace
+
 #endif
index 392a96c11c622c2baaa4357f09ff5bdf5e120521..3cef19ea0e0539940c35c2598f9e5d2ed5cc5321 100644 (file)
@@ -17,6 +17,8 @@
 #include "Support/STLExtras.h"
 #include <algorithm>
 
+namespace llvm {
+
 // for asserting this IG node is infact in the IGNodeList of this class
 inline static void assertIGNode(const InterferenceGraph *IG,
                                 const IGNode *Node) {
@@ -246,3 +248,5 @@ void InterferenceGraph::printIGNodeList() const {
     }
   }
 }
+
+} // End llvm namespace
index 6b8cf3cd053b7ece3b91e10a4d5f45de58785ef6..79850c1fcf017e5e5b209c829a1bd5960ed5674c 100644 (file)
@@ -30,6 +30,9 @@
 #define INTERFERENCEGRAPH_H
 
 #include <vector>
+
+namespace llvm {
+
 class LiveRange;
 class RegClass;
 class IGNode;
@@ -67,4 +70,6 @@ class InterferenceGraph {
   void printIGNodeList() const;
 };
 
+} // End llvm namespace
+
 #endif
index aa409c63fbcc2fd508b7d849694e4369a7456f45..d6e2cf63072a9a274371622a1b2e8391782a2393 100644 (file)
@@ -21,6 +21,8 @@
 #include "llvm/Value.h"
 #include "llvm/CodeGen/ValueSet.h"
 
+namespace llvm {
+
 class RegClass;
 class IGNode;
 
@@ -177,4 +179,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif
index b9fcda789f78c7621990784b5f3ac18cc24270cc..9fd04d2b0e45e25c96fe486f34f2c7f10c7673c1 100644 (file)
@@ -23,6 +23,8 @@
 #include "llvm/Target/TargetRegInfo.h"
 #include "Support/SetOperations.h"
 
+namespace llvm {
+
 unsigned LiveRange::getRegClassID() const { return getRegClass()->getID(); }
 
 LiveRangeInfo::LiveRangeInfo(const Function *F, const TargetMachine &tm,
@@ -411,3 +413,5 @@ void LiveRangeInfo::printLiveRanges() {
     }
   }
 }
+
+} // End llvm namespace
index 5c5244bd62cfdd4c14da37a7589b3b8f5b8c9552..a8d0e7152f19f4cafa6cb466dcb6288a5207725e 100644 (file)
@@ -29,6 +29,8 @@
 #include "llvm/CodeGen/ValueSet.h"
 #include "Support/hash_map"
 
+namespace llvm {
+
 class LiveRange;
 class MachineInstr;
 class RegClass;
@@ -121,4 +123,6 @@ public:
   void printLiveRanges();
 };
 
+} // End llvm namespace
+
 #endif 
index 99917cdf0b46918d24a179a05e1871dd22e1640b..332ae9524cb40155980bde006940221ddc8be0af 100644 (file)
@@ -47,6 +47,8 @@
 #include "Support/STLExtras.h"
 #include <cmath>
 
+namespace llvm {
+
 RegAllocDebugLevel_t DEBUG_RA;
 
 /// The reoptimizer wants to be able to grovel through the register
@@ -1392,3 +1394,5 @@ bool PhyRegAlloc::runOnFunction (Function &F) {
   if (DEBUG_RA) std::cerr << "\nRegister allocation complete!\n"; 
   return false;     // Function was not modified
 } 
+
+} // End llvm namespace
index c524f9f56cbe569b15c303c6885fb01a452f6287..4ec083c8ea32df6ed42ac9a07d496bd278a8b12e 100644 (file)
@@ -31,6 +31,8 @@
 #include "llvm/Target/TargetRegInfo.h"
 #include <map>
 
+namespace llvm {
+
 class MachineFunction;
 class FunctionLiveVarInfo;
 class MachineInstr;
@@ -179,4 +181,6 @@ private:
   void addInterf4PseudoInstr(const MachineInstr *MI);
 };
 
+} // End llvm namespace
+
 #endif
index 97d102a253ab2134b5038f0fb7c8b09f4cc27ac6..7dd86b205af8cf1fe5b909fcc89b1aa6693b657c 100644 (file)
@@ -14,6 +14,8 @@
 #ifndef REGALLOCCOMMON_H
 #define REGALLOCCOMMON_H
 
+namespace llvm {
+
 enum RegAllocDebugLevel_t {
   RA_DEBUG_None         = 0,
   RA_DEBUG_Results      = 1,
@@ -25,4 +27,6 @@ enum RegAllocDebugLevel_t {
 
 extern RegAllocDebugLevel_t DEBUG_RA;
 
+} // End llvm namespace
+
 #endif
index 9c8603b82c3a366e2cf8f97620b4f590bdfd68c5..9af87ba0e86e9532a1fd5f640b05f553b3f198cf 100644 (file)
@@ -16,6 +16,8 @@
 #include "RegClass.h"
 #include "llvm/Target/TargetRegInfo.h"
 
+namespace llvm {
+
 //----------------------------------------------------------------------------
 // This constructor inits IG. The actual matrix is created by a call to 
 // createInterferenceGraph() above.
@@ -245,4 +247,4 @@ void RegClass::printIG() {
   IG.printIG(); 
 }
 
-
+} // End llvm namespace
index c861fbae210e48284cc2c86eed6e2635317ea8a6..0071f7c2129c34169fc516f94f4f7320ae378d64 100644 (file)
@@ -20,6 +20,9 @@
 #include "llvm/Target/TargetRegInfo.h"
 #include "InterferenceGraph.h"
 #include <stack>
+
+namespace llvm {
+
 class TargetRegClassInfo;
 
 
@@ -139,4 +142,6 @@ class RegClass {
   void printIG();
 };
 
+} // End llvm namespace
+
 #endif
index 8d19b694715412c720d1f5b65ec481b2b46e2adb..080e6c69c0bcc2706f7ede1292e5bd81aa9fa13d 100644 (file)
@@ -26,6 +26,8 @@
 #include "Support/Statistic.h"
 #include <iostream>
 
+namespace llvm {
+
 namespace {
   Statistic<> NumSpilled ("ra-local", "Number of registers spilled");
   Statistic<> NumReloaded("ra-local", "Number of registers reloaded");
@@ -203,7 +205,6 @@ namespace {
   };
 }
 
-
 /// getStackSpaceFor - This allocates space for the specified virtual register
 /// to be held on the stack.
 int RA::getStackSpaceFor(unsigned VirtReg, const TargetRegisterClass *RC) {
@@ -674,3 +675,5 @@ bool RA::runOnMachineFunction(MachineFunction &Fn) {
 FunctionPass *createLocalRegisterAllocator() {
   return new RA();
 }
+
+} // End llvm namespace
index a210790b8dd77f0313d02be7fae97e4c9ac01c23..202123ad106373c38de89a89ad9717cb21d3f524 100644 (file)
@@ -26,6 +26,8 @@
 #include "Support/Statistic.h"
 #include <iostream>
 
+namespace llvm {
+
 namespace {
   Statistic<> NumSpilled ("ra-simple", "Number of registers spilled");
   Statistic<> NumReloaded("ra-simple", "Number of registers reloaded");
@@ -234,3 +236,5 @@ bool RegAllocSimple::runOnMachineFunction(MachineFunction &Fn) {
 FunctionPass *createSimpleRegisterAllocator() {
   return new RegAllocSimple();
 }
+
+} // End llvm namespace
index a972ddf6026bc83b943aec58817215ae7b80e588..fd4e7a90c7dc03092a3b81e11a64c83914d89b26 100644 (file)
@@ -21,6 +21,8 @@
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Support/InstVisitor.h"
 
+namespace llvm {
+
 struct SelectionDAGBuilder : public InstVisitor<SelectionDAGBuilder> {
   // DAG - the current dag we are building.
   SelectionDAG &DAG;
@@ -270,3 +272,5 @@ SelectionDAG::SelectionDAG(MachineFunction &f, const TargetMachine &tm,
     SDB.visitBB(const_cast<BasicBlock&>(*I));
   Root = SDB.CurRoot;
 }
+
+} // End llvm namespace
index 58a9639c92b249cd8bb66cc6124fbcdc7a91ebdf..db5941060dbe60fdfb46b8bfb61e6b873c960ea7 100644 (file)
@@ -15,6 +15,8 @@
 #include "llvm/CodeGen/SelectionDAG.h"
 #include "llvm/Type.h"
 
+namespace llvm {
+
 SelectionDAG::~SelectionDAG() {
   for (unsigned i = 0, e = AllNodes.size(); i != e; ++i)
     delete AllNodes[i];
@@ -126,3 +128,5 @@ void SelectionDAGNode::printit(unsigned Offset, unsigned &LastID,
 
   std::cerr << "\n";
 }
+
+} // End llvm namespace
index dd647247c3fe7ad455d0b2105339cacef4b55591..b7da23ca714600af49b015170b70377b5789c8e9 100644 (file)
@@ -27,6 +27,8 @@
 #include "Support/DynamicLinker.h"
 #include "Config/dlfcn.h"
 
+namespace llvm {
+
 Statistic<> NumInitBytes("lli", "Number of bytes of global vars initialized");
 
 ExecutionEngine::ExecutionEngine(ModuleProvider *P) : 
@@ -390,3 +392,4 @@ void ExecutionEngine::emitGlobals() {
       InitializeMemory(I->getInitializer(), GlobalAddress[I]);
 }
 
+} // End llvm namespace
index b04f974911d6b0b5a6ef98125fa4cf2cee733145..aa32983cc38dce8565c2fb502ed184bed820076c 100644 (file)
 #include "Support/Statistic.h"
 #include <cmath>  // For fmod
 
-Interpreter *TheEE = 0;
+namespace llvm {
 
 namespace {
   Statistic<> NumDynamicInsts("lli", "Number of dynamic instructions executed");
 }
 
+Interpreter *TheEE = 0;
+
 //===----------------------------------------------------------------------===//
 //                     Value Manipulation code
 //===----------------------------------------------------------------------===//
@@ -910,3 +912,5 @@ void Interpreter::run() {
     visit(I);   // Dispatch to one of the visit* methods...
   }
 }
+
+} // End llvm namespace
index ecf19c2f8d51726673302f419fd2e31f687719ce..f516f5de23e3e43a27e60b0aec561389ee7c8a32 100644 (file)
@@ -32,6 +32,8 @@
 #include <map>
 using std::vector;
 
+namespace llvm {
+
 typedef GenericValue (*ExFunc)(FunctionType *, const vector<GenericValue> &);
 static std::map<const Function *, ExFunc> Functions;
 static std::map<std::string, ExFunc> FuncNames;
@@ -767,3 +769,5 @@ void Interpreter::initializeExternalFunctions() {
   FuncNames["lle_X_llvm.va_end"]  = llvm_va_end;
   FuncNames["lle_X_llvm.va_copy"] = llvm_va_copy;
 }
+
+} // End llvm namespace
index bcaa8569dc47b5367e8d6466e95b9ec6a458f85d..bb14cd2ee89abbb3b8b0d797bdc0813ea9e8dbef 100644 (file)
@@ -17,6 +17,8 @@
 #include "llvm/Module.h"
 #include "llvm/DerivedTypes.h"
 
+namespace llvm {
+
 /// create - Create a new interpreter object.  This can never fail.
 ///
 ExecutionEngine *Interpreter::create(Module *M){
@@ -97,3 +99,5 @@ GenericValue Interpreter::run(Function *F,
   rv.IntVal = ExitCode;
   return rv;
 }
+
+} // End llvm namespace
index 00784adb7149efdc9f2c2bc3596a6858f3727f76..e9015a203e9f36fbafaf0f6db1a741fc97b4f8ff 100644 (file)
@@ -22,6 +22,8 @@
 #include "llvm/Target/TargetData.h"
 #include "Support/DataTypes.h"
 
+namespace llvm {
+
 struct FunctionInfo;        // Defined in ExecutionAnnotations.h
 
 // AllocaHolder - Object to track all of the blocks of memory allocated by
@@ -166,4 +168,6 @@ private:  // Helper functions
   void popStackAndReturnValueToCaller(const Type *RetTy, GenericValue Result);
 };
 
+} // End llvm namespace
+
 #endif
index 6162e938aba717c56bdbcf7322823ce6f89b5995..191b57d22a052909bf093aeac6f9f3b489294a72 100644 (file)
@@ -19,6 +19,8 @@
 #include "Support/DynamicLinker.h"
 #include <iostream>
 
+namespace llvm {
+
 // AtExitHandlers - List of functions to call when the program exits,
 // registered with the atexit() library function.
 static std::vector<void (*)()> AtExitHandlers;
@@ -75,3 +77,5 @@ void *VM::getPointerToNamedFunction(const std::string &Name) {
   
   return Ptr;
 }
+
+} // End llvm namespace
index fedb6e46b087b70351128fabef014a24b3273f12..61d9629d93e0a7d782af5afd1754d57d990750dc 100644 (file)
@@ -24,6 +24,8 @@
 #define NO_JITS_ENABLED
 #endif
 
+namespace llvm {
+
 namespace {
   enum ArchName { x86, Sparc };
 
@@ -118,3 +120,5 @@ GenericValue VM::run(Function *F, const std::vector<GenericValue> &ArgValues)
   rv.IntVal = ExitCode;
   return rv;
 }
+
+} // End llvm namespace
index 685c4bd0534cd9055131e04dcfdf3956f26a966a..9a17c967c70c51dda91acedebd4cab151aaf44d3 100644 (file)
@@ -18,6 +18,8 @@
 #include "llvm/PassManager.h"
 #include <map>
 
+namespace llvm {
+
 class Function;
 class GlobalValue;
 class Constant;
@@ -78,4 +80,6 @@ private:
   void runJITOnFunction (Function *F);
 };
 
+} // End llvm namespace
+
 #endif
index 98f526a5f5379490d80a3b34293495abcb193e47..32d0651f22675c111711e54e4b29439cf3c7b871 100644 (file)
@@ -27,6 +27,8 @@
 #include "Config/unistd.h"
 #include "Config/sys/mman.h"
 
+namespace llvm {
+
 namespace {
   Statistic<> NumBytes("jit", "Number of bytes of machine code compiled");
   VM *TheVM = 0;
@@ -265,3 +267,5 @@ extern "C" {
     return TheVM->getPointerToNamedFunction(Name);
   }
 }
+
+} // End llvm namespace
index 2dda271fa0ad4018dd9c1063abba428eabda2a7b..d7e76859788912dcbfbc845956543b5b74c8bd37 100644 (file)
@@ -19,6 +19,8 @@
 #include "llvm/CodeGen/MachineCodeEmitter.h"
 #include "llvm/Target/TargetMachine.h"
 
+namespace llvm {
+
 VM::~VM() {
   delete MCE;
   delete &TM;
@@ -98,3 +100,5 @@ void *VM::recompileAndRelinkFunction(Function *F) {
   TM.replaceMachineCodeForFunction (OldAddr, Addr);
   return Addr;
 }
+
+} // End llvm namespace
index 685c4bd0534cd9055131e04dcfdf3956f26a966a..9a17c967c70c51dda91acedebd4cab151aaf44d3 100644 (file)
@@ -18,6 +18,8 @@
 #include "llvm/PassManager.h"
 #include <map>
 
+namespace llvm {
+
 class Function;
 class GlobalValue;
 class Constant;
@@ -78,4 +80,6 @@ private:
   void runJITOnFunction (Function *F);
 };
 
+} // End llvm namespace
+
 #endif
index 06f0635749bdb5b155039444cc8ffaa7b6a6270a..9c228917754b0a9ec8dd8175f7551a83d5aaae6d 100644 (file)
@@ -30,6 +30,8 @@
 #include <memory>
 #include <set>
 
+namespace llvm {
+
 /// FindLib - Try to convert Filename into the name of a file that we can open,
 /// if it does not already name a file we can open, by first trying to open
 /// Filename, then libFilename.<suffix> for each of a set of several common
@@ -405,3 +407,5 @@ bool LinkLibraries(const char *progname,
 
   return false;
 }
+
+} // End llvm namespace
index 0be840fb6cd8189df793db59ab5325435e788857..4bc78a4cde3c5b3d39066e3c58fab6f5717ac139 100644 (file)
@@ -23,6 +23,8 @@
 #include "llvm/iOther.h"
 #include "llvm/Constants.h"
 
+namespace llvm {
+
 // Error - Simple wrapper function to conditionally assign to E and return true.
 // This just makes error return conditions a little bit simpler...
 //
@@ -902,3 +904,4 @@ bool LinkModules(Module *Dest, const Module *Src, std::string *ErrorMsg) {
   return false;
 }
 
+} // End llvm namespace
index 890b18de06c44e6b3c3c42edf47e81332c403560..b88624dd1f0d059de2651e00fa37b19818bed19d 100644 (file)
@@ -14,6 +14,8 @@
 #include <map>
 #include "Support/Annotation.h"
 
+namespace llvm {
+
 typedef std::map<const std::string, unsigned> IDMapType;
 static unsigned IDCounter = 0;  // Unique ID counter
 
@@ -94,3 +96,5 @@ Annotation *AnnotationManager::createAnnotation(AnnotationID ID,
   if (I == getFactMap().end()) return 0;
   return I->second.first(ID, Obj, I->second.second);
 }
+
+} // End llvm namespace
index de895c9117661a17b2ae3355e85efc2a55f1f0cb..235dc1284337565f954778c7064aa9b2b61a8b9a 100644 (file)
@@ -24,6 +24,8 @@
 #include <cstdlib>
 #include <cerrno>
 
+namespace llvm {
+
 using namespace cl;
 
 //===----------------------------------------------------------------------===//
@@ -887,3 +889,5 @@ HHOp("help-hidden", cl::desc("display all available options"),
      cl::location(HiddenPrinter), cl::Hidden, cl::ValueDisallowed);
 
 } // End anonymous namespace
+
+} // End llvm namespace
index a9e1204de52db2999ff1cb2422e5d2dde56cebaf..e180f12a1a045f2b7fa14fa731c90bc8d266e081 100644 (file)
@@ -26,6 +26,8 @@
 #include "llvm/Instruction.h"
 #include "llvm/ConstantHandling.h"
 
+namespace llvm {
+
 /// Initialize a full (the default) or empty set for the specified type.
 ///
 ConstantRange::ConstantRange(const Type *Ty, bool Full) {
@@ -248,3 +250,5 @@ void ConstantRange::print(std::ostream &OS) const {
 void ConstantRange::dump() const {
   print(std::cerr);
 }
+
+} // End llvm namespace
index 895abbb1f76d28497ce7bbc7ea350e69237ab3ee..1af23380a27b50321d02bbb95ec25e19d5d4a129 100644 (file)
@@ -26,6 +26,8 @@
 #include "Support/Statistic.h"
 #include "Support/CommandLine.h"
 
+namespace llvm {
+
 bool DebugFlag;  // DebugFlag - Exported boolean set by the -debug option
 
 namespace {
@@ -62,3 +64,5 @@ bool isCurrentDebugType(const char *DebugType) {
   return false;
 #endif
 }
+
+} // End llvm namespace
index 74b360367934e4d9ac2c23e155228d29b58964b0..1c9385eea7d61cf362bf39a17b841c265d56581a 100644 (file)
@@ -23,6 +23,8 @@
 #include "Config/dlfcn.h"
 #include <cassert>
 
+namespace llvm {
+
 bool LinkDynamicObject (const char *filename, std::string *ErrorMessage) {
 #if defined (HAVE_DLOPEN)
   if (dlopen (filename, RTLD_NOW | RTLD_GLOBAL) == 0) {
@@ -52,3 +54,5 @@ void *GetAddressOfSymbol (const char *symbolName) {
 void *GetAddressOfSymbol (const std::string &symbolName) {
   return GetAddressOfSymbol (symbolName.c_str ());
 }
+
+} // End llvm namespace
index 3262ecce316546ba8dc3f8a7e7695f460782df23..cde288925be3f3027ab7f9a947640faa204d1c22 100644 (file)
@@ -20,6 +20,9 @@
 #include <iostream>
 #include <cstdio>
 
+namespace llvm
+{
+
 /// CheckMagic - Returns true IFF the file named FN begins with Magic. FN must
 /// name a readable file.
 ///
@@ -182,3 +185,5 @@ bool MakeFileExecutable (const std::string &Filename) {
 bool MakeFileReadable (const std::string &Filename) {
   return AddPermissionsBits (Filename, 0444);
 }
+
+} // End llvm namespace
index 24c946ab6ea4109b9af889abda3b565cea1c2f23..ffb081a998201e696db07fe1ef726faa8e757d6b 100644 (file)
@@ -15,6 +15,8 @@
 #include "llvm/Value.h"
 #include <set>
 
+namespace llvm {
+
 // Lazily allocate set so that release build doesn't have to do anything.
 static std::set<const void*> *Objects = 0;
 static std::set<const Value*> *LLVMObjects = 0;
@@ -87,3 +89,5 @@ void LeakDetector::checkForGarbageImpl(const std::string &Message) {
     Objects = 0; LLVMObjects = 0;
   }
 }
+
+} // End llvm namespace
index 44c697d3d8fa9eda235d518f826400bd2f29bf41..567fe05e3202aecf3d11d9831be348c8a2b3d19d 100644 (file)
@@ -16,6 +16,8 @@
 #include "llvm/Type.h"
 #include "Support/StringExtras.h"
 
+namespace llvm {
+
 static char HexDigit(int V) {
   return V < 10 ? V+'0' : V+'A'-10;
 }
@@ -99,3 +101,4 @@ Mangler::Mangler(Module &m, bool addUnderscorePrefix)
         FoundNames.insert(I->getName());   // Otherwise, keep track of name
 }
 
+} // End llvm namespace
index 1582a10c653718fc7bf9d53426633026079e2f18..1729bb33655769b8487060778bd3d4e046e16e07 100644 (file)
@@ -23,6 +23,8 @@
 #include "Config/link.h"
 #include <iostream>
 
+namespace llvm {
+
 namespace {
   struct PluginLoader {
     void operator=(const std::string &Filename) {
@@ -38,3 +40,5 @@ namespace {
 static cl::opt<PluginLoader, false, cl::parser<std::string> >
 LoadOpt("load", cl::ZeroOrMore, cl::value_desc("plugin.so"),
         cl::desc("Load the specified plugin"));
+
+} // End llvm namespace
index efc5f712578313a58aacb65f000c6a3399939f5a..73decfd89be6019181d5ac72a9c2f7e05e96e568 100644 (file)
@@ -20,6 +20,8 @@
 #include <signal.h>
 #include "Config/config.h"     // Get the signal handler return type
 
+namespace llvm {
+
 static std::vector<std::string> FilesToRemove;
 
 // IntSigs - Signals that may interrupt the program at any time.
@@ -62,3 +64,5 @@ void RemoveFileOnSignal(const std::string &Filename) {
   std::for_each(IntSigs, IntSigsEnd, RegisterHandler);
   std::for_each(KillSigs, KillSigsEnd, RegisterHandler);
 }
+
+} // End llvm namespace
index c60a85cdeb6d87d9401d8582632286370e1fd909..3ac2bf97fbe20fe0bb349d0be77658b444b616a7 100644 (file)
 #include <iostream>
 #include <algorithm>
 
+namespace llvm {
+
 // GetLibSupportInfoOutputFile - Return a file stream to print our output on...
-std::ostream *GetLibSupportInfoOutputFile();
+extern std::ostream *GetLibSupportInfoOutputFile();
 
 unsigned StatisticBase::NumStats = 0;
 
@@ -104,3 +106,5 @@ void StatisticBase::destroy() const {
       delete OutStream;   // Close the file...
   }
 }
+
+} // End llvm namespace
index 8c009ffb5737a35dde89d69a4d337ace57312225..ec535ad45a2d4d38d4f6b63bba4c55b07fe0f0b8 100644 (file)
@@ -24,6 +24,8 @@
 #include "Config/unistd.h"
 #include "Config/errno.h"
 
+namespace llvm {
+
 /// isExecutableFile - This function returns true if the filename specified
 /// exists and is executable.
 ///
@@ -272,3 +274,4 @@ ExecWait (const char * const old_argv[], const char * const old_envp[])
   return 1;
 }
 
+} // End llvm namespace
index 5e84f38852b722d3ffb5c75566b0ba2050e9011b..d14a225fcf26c7aba4e1743b4e79e945cdc04495 100644 (file)
@@ -23,6 +23,8 @@
 #include <fstream>
 #include <map>
 
+namespace llvm {
+
 // getLibSupportInfoOutputFilename - This ugly hack is brought to you courtesy
 // of constructor/destructor ordering being unspecified by C++.  Basically the
 // problem is that a Statistic<> object gets destroyed, which ends up calling
@@ -265,7 +267,8 @@ void Timer::print(const Timer &Total, std::ostream &OS) {
 }
 
 // GetLibSupportInfoOutputFile - Return a file stream to print our output on...
-std::ostream *GetLibSupportInfoOutputFile() {
+std::ostream *
+GetLibSupportInfoOutputFile() {
   std::string &LibSupportInfoOutputFilename = getLibSupportInfoOutputFilename();
   if (LibSupportInfoOutputFilename.empty())
     return &std::cerr;
@@ -349,3 +352,5 @@ void TimerGroup::removeTimer() {
     DefaultTimerGroup = 0;
   }
 }
+
+} // End llvm namespace
index a66b868c22cdc5f064c888b2816b8f6810ea0e7a..50a9ad21c8598bdf1993adfed2e25d6d7e087f1a 100644 (file)
@@ -18,6 +18,8 @@
 #include <iostream>
 #include <fstream>
 
+namespace llvm {
+
 //===---------------------------------------------------------------------===//
 // LLI Implementation of AbstractIntepreter interface
 //
@@ -391,3 +393,5 @@ GCC *GCC::create(const std::string &ProgramPath, std::string &Message) {
   Message = "Found gcc: " + GCCPath + "\n";
   return new GCC(GCCPath);
 }
+
+} // End llvm namespace
index 8661402b0613372f43ec8164f98711005c607e68..77fdaf6b44c21ac1fe200f1ea15f37d23191ac9d 100644 (file)
 #include "llvm/Support/ValueHolder.h"
 #include "llvm/Type.h"
 
+namespace llvm {
+
 ValueHolder::ValueHolder(Value *V) : User(Type::TypeTy, Value::TypeVal) {
   Operands.push_back(Use(V, this));
 }
+
+} // End llvm namespace
index 258c2878787585cce8a82ddc3120ec7e6fc6abe0..bac088abf7fb9a8757e921ed99bb5a4b5f7dd4b1 100644 (file)
@@ -31,6 +31,8 @@
 #include <algorithm>
 #include <sstream>
 
+namespace llvm {
+
 namespace {
   class CWriter : public Pass, public InstVisitor<CWriter> {
     std::ostream &Out; 
@@ -161,7 +163,6 @@ namespace {
     void printIndexingExpression(Value *Ptr, User::op_iterator I,
                                  User::op_iterator E);
   };
-}
 
 // Pass the Type* and the variable name and this prints out the variable
 // declaration.
@@ -339,7 +340,7 @@ void CWriter::printConstantArray(ConstantArray *CPA) {
 // compiler agreeing on the conversion process (which is pretty likely since we
 // only deal in IEEE FP).
 //
-static bool isFPCSafeToPrint(const ConstantFP *CFP) {
+bool isFPCSafeToPrint(const ConstantFP *CFP) {
 #if HAVE_PRINTF_A
   char Buffer[100];
   sprintf(Buffer, "%a", CFP->getValue());
@@ -563,7 +564,7 @@ bool CWriter::nameAllUsedStructureTypes(Module &M) {
 // generateCompilerSpecificCode - This is where we add conditional compilation
 // directives to cater to specific compilers as need be.
 //
-static void generateCompilerSpecificCode(std::ostream& Out) {
+void generateCompilerSpecificCode(std::ostream& Out) {
   // Alloca is hard to get, and we don't want to include stdlib.h here...
   Out << "/* get a declaration for alloca */\n"
       << "#ifdef sun\n"
@@ -1058,7 +1059,7 @@ void CWriter::visitUnwindInst(UnwindInst &I) {
   emittedInvoke = true;
 }
 
-static bool isGotoCodeNecessary(BasicBlock *From, BasicBlock *To) {
+bool isGotoCodeNecessary(BasicBlock *From, BasicBlock *To) {
   // If PHI nodes need copies, we need the copy code...
   if (isa<PHINode>(To->front()) ||
       From->getNext() != To)      // Not directly successor, need goto
@@ -1195,10 +1196,10 @@ void CWriter::visitCastInst(CastInst &I) {
 void CWriter::visitCallInst(CallInst &I) {
   // Handle intrinsic function calls first...
   if (Function *F = I.getCalledFunction())
-    if (LLVMIntrinsic::ID ID = (LLVMIntrinsic::ID)F->getIntrinsicID()) {
+    if (Intrinsic::ID ID = (Intrinsic::ID)F->getIntrinsicID()) {
       switch (ID) {
       default:  assert(0 && "Unknown LLVM intrinsic!");
-      case LLVMIntrinsic::va_start: 
+      case Intrinsic::va_start: 
         Out << "0; ";
         
         Out << "va_start(*(va_list*)&" << Mang->getValueName(&I) << ", ";
@@ -1212,28 +1213,28 @@ void CWriter::visitCallInst(CallInst &I) {
         writeOperand(&I.getParent()->getParent()->aback());
         Out << ")";
         return;
-      case LLVMIntrinsic::va_end:
+      case Intrinsic::va_end:
         Out << "va_end(*(va_list*)&";
         writeOperand(I.getOperand(1));
         Out << ")";
         return;
-      case LLVMIntrinsic::va_copy:
+      case Intrinsic::va_copy:
         Out << "0;";
         Out << "va_copy(*(va_list*)&" << Mang->getValueName(&I) << ", ";
         Out << "*(va_list*)&";
         writeOperand(I.getOperand(1));
         Out << ")";
         return;
-      case LLVMIntrinsic::setjmp:
-      case LLVMIntrinsic::sigsetjmp:
+      case Intrinsic::setjmp:
+      case Intrinsic::sigsetjmp:
         // This intrinsic should never exist in the program, but until we get
         // setjmp/longjmp transformations going on, we should codegen it to
         // something reasonable.  This will allow code that never calls longjmp
         // to work.
         Out << "0";
         return;
-      case LLVMIntrinsic::longjmp:
-      case LLVMIntrinsic::siglongjmp:
+      case Intrinsic::longjmp:
+      case Intrinsic::siglongjmp:
         // Longjmp is not implemented, and never will be.  It would cause an
         // exception throw.
         Out << "abort()";
@@ -1385,9 +1386,12 @@ void CWriter::visitVAArgInst(VAArgInst &I) {
   Out << ");\n  va_end(Tmp); }";
 }
 
+}
 
 //===----------------------------------------------------------------------===//
 //                       External Interface declaration
 //===----------------------------------------------------------------------===//
 
 Pass *createWriteToCPass(std::ostream &o) { return new CWriter(o); }
+
+} // End llvm namespace
index 258c2878787585cce8a82ddc3120ec7e6fc6abe0..bac088abf7fb9a8757e921ed99bb5a4b5f7dd4b1 100644 (file)
@@ -31,6 +31,8 @@
 #include <algorithm>
 #include <sstream>
 
+namespace llvm {
+
 namespace {
   class CWriter : public Pass, public InstVisitor<CWriter> {
     std::ostream &Out; 
@@ -161,7 +163,6 @@ namespace {
     void printIndexingExpression(Value *Ptr, User::op_iterator I,
                                  User::op_iterator E);
   };
-}
 
 // Pass the Type* and the variable name and this prints out the variable
 // declaration.
@@ -339,7 +340,7 @@ void CWriter::printConstantArray(ConstantArray *CPA) {
 // compiler agreeing on the conversion process (which is pretty likely since we
 // only deal in IEEE FP).
 //
-static bool isFPCSafeToPrint(const ConstantFP *CFP) {
+bool isFPCSafeToPrint(const ConstantFP *CFP) {
 #if HAVE_PRINTF_A
   char Buffer[100];
   sprintf(Buffer, "%a", CFP->getValue());
@@ -563,7 +564,7 @@ bool CWriter::nameAllUsedStructureTypes(Module &M) {
 // generateCompilerSpecificCode - This is where we add conditional compilation
 // directives to cater to specific compilers as need be.
 //
-static void generateCompilerSpecificCode(std::ostream& Out) {
+void generateCompilerSpecificCode(std::ostream& Out) {
   // Alloca is hard to get, and we don't want to include stdlib.h here...
   Out << "/* get a declaration for alloca */\n"
       << "#ifdef sun\n"
@@ -1058,7 +1059,7 @@ void CWriter::visitUnwindInst(UnwindInst &I) {
   emittedInvoke = true;
 }
 
-static bool isGotoCodeNecessary(BasicBlock *From, BasicBlock *To) {
+bool isGotoCodeNecessary(BasicBlock *From, BasicBlock *To) {
   // If PHI nodes need copies, we need the copy code...
   if (isa<PHINode>(To->front()) ||
       From->getNext() != To)      // Not directly successor, need goto
@@ -1195,10 +1196,10 @@ void CWriter::visitCastInst(CastInst &I) {
 void CWriter::visitCallInst(CallInst &I) {
   // Handle intrinsic function calls first...
   if (Function *F = I.getCalledFunction())
-    if (LLVMIntrinsic::ID ID = (LLVMIntrinsic::ID)F->getIntrinsicID()) {
+    if (Intrinsic::ID ID = (Intrinsic::ID)F->getIntrinsicID()) {
       switch (ID) {
       default:  assert(0 && "Unknown LLVM intrinsic!");
-      case LLVMIntrinsic::va_start: 
+      case Intrinsic::va_start: 
         Out << "0; ";
         
         Out << "va_start(*(va_list*)&" << Mang->getValueName(&I) << ", ";
@@ -1212,28 +1213,28 @@ void CWriter::visitCallInst(CallInst &I) {
         writeOperand(&I.getParent()->getParent()->aback());
         Out << ")";
         return;
-      case LLVMIntrinsic::va_end:
+      case Intrinsic::va_end:
         Out << "va_end(*(va_list*)&";
         writeOperand(I.getOperand(1));
         Out << ")";
         return;
-      case LLVMIntrinsic::va_copy:
+      case Intrinsic::va_copy:
         Out << "0;";
         Out << "va_copy(*(va_list*)&" << Mang->getValueName(&I) << ", ";
         Out << "*(va_list*)&";
         writeOperand(I.getOperand(1));
         Out << ")";
         return;
-      case LLVMIntrinsic::setjmp:
-      case LLVMIntrinsic::sigsetjmp:
+      case Intrinsic::setjmp:
+      case Intrinsic::sigsetjmp:
         // This intrinsic should never exist in the program, but until we get
         // setjmp/longjmp transformations going on, we should codegen it to
         // something reasonable.  This will allow code that never calls longjmp
         // to work.
         Out << "0";
         return;
-      case LLVMIntrinsic::longjmp:
-      case LLVMIntrinsic::siglongjmp:
+      case Intrinsic::longjmp:
+      case Intrinsic::siglongjmp:
         // Longjmp is not implemented, and never will be.  It would cause an
         // exception throw.
         Out << "abort()";
@@ -1385,9 +1386,12 @@ void CWriter::visitVAArgInst(VAArgInst &I) {
   Out << ");\n  va_end(Tmp); }";
 }
 
+}
 
 //===----------------------------------------------------------------------===//
 //                       External Interface declaration
 //===----------------------------------------------------------------------===//
 
 Pass *createWriteToCPass(std::ostream &o) { return new CWriter(o); }
+
+} // End llvm namespace
index 6f358152638420f875c4c8b05c8573f088a05b56..7c1028bc32379834f7e77fb5819c4a94cedabadf 100644 (file)
@@ -13,6 +13,8 @@
 
 #include "llvm/Target/MRegisterInfo.h"
 
+namespace llvm {
+
 MRegisterInfo::MRegisterInfo(const MRegisterDesc *D, unsigned NR,
                              regclass_iterator RCB, regclass_iterator RCE,
                             int CFSO, int CFDO)
@@ -41,3 +43,5 @@ MRegisterInfo::MRegisterInfo(const MRegisterDesc *D, unsigned NR,
 MRegisterInfo::~MRegisterInfo() {
   delete[] PhysRegClasses;
 }
+
+} // End llvm namespace
index 2c45021f007b32bde71ba79d51c1a5216f3ae401..a603e94b8190829b759b6f23ca276aa189cc71e6 100644 (file)
@@ -18,6 +18,8 @@
 #include "llvm/Bytecode/Writer.h"
 #include <iostream>
 
+namespace llvm {
+
 using std::ostream;
 
 namespace {
@@ -113,3 +115,5 @@ namespace {
 Pass *UltraSparc::getBytecodeAsmPrinterPass(std::ostream &Out) {
   return new SparcBytecodeWriter(Out);
 }
+
+} // End llvm namespace
index a50439de7f66fe5d236c1d038ffe8d480b01c6e6..4e2bf4787632697984c31df772de4e7dccce06bd 100644 (file)
@@ -22,6 +22,8 @@
 #include "Support/CommandLine.h"
 #include <algorithm>
 
+namespace llvm {
+
 SchedDebugLevel_t SchedDebugLevel;
 
 static cl::opt<bool> EnableFillingDelaySlots("sched-fill-delay-slots",
@@ -1518,3 +1520,6 @@ bool InstructionSchedulingWithSSA::runOnFunction(Function &F)
 FunctionPass *createInstructionSchedulingWithSSAPass(const TargetMachine &tgt) {
   return new InstructionSchedulingWithSSA(tgt);
 }
+
+} // End llvm namespace
+
index e7cd47881ac135858b45b688a95b65b15b5e01cc..3a8088043bf75f0346ccb1ce560d44b22dd9e80f 100644 (file)
@@ -23,6 +23,8 @@
 #include "llvm/Target/TargetRegInfo.h"
 #include "Support/STLExtras.h"
 
+namespace llvm {
+
 //*********************** Internal Data Structures *************************/
 
 // The following two types need to be classes, not typedefs, so we can use
@@ -737,3 +739,5 @@ void SchedGraphNode::print(std::ostream &os) const {
       os << std::string(16, ' ') << *outEdges[i];
   }
 }
+
+} // End llvm namespace
index 50cc0520e6f35f1c834d391e67e83cded00e7e46..5aee9b25f6939f0817baa4c0d6eccee680f480d0 100644 (file)
@@ -25,6 +25,8 @@
 #include "Support/hash_map"
 #include "Support/GraphTraits.h"
 
+namespace llvm {
+
 class RegToRefVecMap;
 class ValueToDefVecMap;
 class RefVec;
@@ -317,4 +319,6 @@ template <> struct GraphTraits<const SchedGraph*> {
   }
 };
 
+} // End llvm namespace
+
 #endif
index b75e3397cb99ad7b6198a9c2582bcf9bf06a60f0..d96c201c8a2cf3c717a56aaa89a3e17c4a697f53 100644 (file)
@@ -15,6 +15,8 @@
 #include "llvm/CodeGen/SchedGraphCommon.h"
 #include "Support/STLExtras.h"
 
+namespace llvm {
+
 class SchedGraphCommon;
 
 //
@@ -175,3 +177,4 @@ void SchedGraphCommon::eraseIncidentEdges(SchedGraphNodeCommon* node,
   this->eraseOutgoingEdges(node, addDummyEdges);       
 }
 
+} // End llvm namespace
index 1644d5ecbc58a96dcf55af9a39768c8492a59459..7e05d1417fde67dc47025359fbc9942861c5642f 100644 (file)
@@ -23,6 +23,8 @@
 #include "llvm/Support/CFG.h"
 #include "Support/PostOrderIterator.h"
 
+namespace llvm {
+
 std::ostream &operator<<(std::ostream &os, const NodeDelayPair* nd) {
   return os << "Delay for node " << nd->node->getNodeId()
            << " = " << (long)nd->delay << "\n";
@@ -278,3 +280,4 @@ SchedPriorities::instructionHasLastUse(FunctionLiveVarInfo &LVI,
   return lastUseMap[MI] = hasLastUse;
 }
 
+} // End llvm namespace
index de321f9fcbf6d3cd2efe7b28052bac7392c5cd67..74704678066088137f9fc3b9e72e0e9c2774d313 100644 (file)
@@ -26,6 +26,8 @@
 #include "Support/hash_set"
 #include <list>
 
+namespace llvm {
+
 class Function;
 class MachineInstr;
 class SchedulingManager;
@@ -214,4 +216,6 @@ inline void SchedPriorities::updateTime(cycles_t c) {
 
 std::ostream &operator<<(std::ostream &os, const NodeDelayPair* nd);
 
+} // End llvm namespace
+
 #endif
index 5496502d5efd6be78b058ef74a507426981eb28f..fd5056d22d7bd6a0fdc94300c620a713690ceceb 100644 (file)
@@ -30,6 +30,8 @@
 #include "Support/STLExtras.h"
 #include "Config/alloca.h"
 
+namespace llvm {
+
 //------------------------------------------------------------------------ 
 // class InstrTreeNode
 //------------------------------------------------------------------------ 
@@ -330,3 +332,5 @@ InstructionNode* InstrForest::buildTreeForInstruction(Instruction *instr) {
   delete [] childArray;
   return treeNode;
 }
+
+} // End llvm namespace
index 0e3e2cdbf25cc6af15c6cfee7519f609b70ad000..760976509c156f325e3ab58d40181ab11042f827 100644 (file)
@@ -28,6 +28,8 @@
 #include "Support/LeakDetector.h"
 #include <vector>
 
+namespace llvm {
+
 std::vector<MachineInstr*>
 FixConstantOperandsForInstr(Instruction* vmInstr, MachineInstr* minstr,
                             TargetMachine& target);
@@ -82,6 +84,8 @@ namespace {
   };
 }
 
+namespace llvm {
+
 TmpInstruction::TmpInstruction(MachineCodeForInstruction& mcfi,
                                Value *s1, Value *s2, const std::string &name)
   : Instruction(s1->getType(), Instruction::UserOp1, name)
@@ -114,6 +118,7 @@ TmpInstruction::TmpInstruction(MachineCodeForInstruction& mcfi,
   LeakDetector::removeGarbageObject(this);
 }
 
+} // End llvm namespace
 
 bool InstructionSelection::runOnFunction(Function &F)
 {
@@ -375,7 +380,6 @@ InstructionSelection::PostprocessMachineCodeForTree(InstructionNode* instrNode,
 }
 
 
-
 //===----------------------------------------------------------------------===//
 // createInstructionSelectionPass - Public entrypoint for instruction selection
 // and this file as a whole...
@@ -383,3 +387,5 @@ InstructionSelection::PostprocessMachineCodeForTree(InstructionNode* instrNode,
 FunctionPass *createInstructionSelectionPass(TargetMachine &T) {
   return new InstructionSelection(T);
 }
+
+} // End llvm namespace
index 93f7618641551a1595bb12ae796efbb00eb33c3c..44a43596ee3bc1b57a3454e7df90e15b804c6227 100644 (file)
@@ -25,6 +25,7 @@
 #include "llvm/DerivedTypes.h"
 #include "../../Target/Sparc/SparcInstrSelectionSupport.h"  // FIXME!
 
+namespace llvm {
 
 // Generate code to load the constant into a TmpInstruction (virtual reg) and
 // returns the virtual register.
@@ -257,3 +258,5 @@ FixConstantOperandsForInstr(Instruction* vmInstr,
   
   return MVec;
 }
+
+} // End llvm namespace
index 68eaebf7d27db6acff761e8c000350177704b6b1..758f1b1539d92968495b5d6a484f00b2bfea0bfa 100644 (file)
@@ -21,6 +21,7 @@
 /// BROKEN: Should not include sparc stuff directly into here
 #include "../../Target/Sparc/SparcInternals.h"  //  Only for PHI defn
 
+namespace llvm {
 
 BBLiveVar::BBLiveVar(const BasicBlock &bb, MachineBasicBlock &mbb, unsigned id)
   : BB(bb), MBB(mbb), POID(id) {
@@ -229,6 +230,4 @@ void BBLiveVar::printInOutSets() const {
   std::cerr << "  Out: ";  printSet(OutSet);  std::cerr << "\n";
 }
 
-
-
-
+} // End llvm namespace
index 33a4faf2b10b591cde6166aa5251864652bb172b..781143a93dfd4c47b930508dfac047bd50b13b23 100644 (file)
@@ -17,6 +17,9 @@
 
 #include "llvm/CodeGen/ValueSet.h"
 #include "Support/hash_map"
+
+namespace llvm {
+
 class BasicBlock;
 class Value;
 class MachineBasicBlock;
@@ -82,4 +85,6 @@ public:
   void printInOutSets() const;    // for printing In/Out sets
 };
 
+} // End llvm namespace
+
 #endif
index 588ec646da766e6d36d97486328e1cd0aae0600b..8f0e31811a9c6fe1a9d479dbb8385a311b4b343c 100644 (file)
@@ -23,6 +23,8 @@
 #include "Support/CommandLine.h"
 #include "BBLiveVar.h"
 
+namespace llvm {
+
 static RegisterAnalysis<FunctionLiveVarInfo>
 X("livevar", "Live Variable Analysis");
 
@@ -318,3 +320,5 @@ void FunctionLiveVarInfo::calcLiveVarSetsForBB(const BasicBlock *BB) {
     SetAI = NewSet;                 
   }
 }
+
+} // End llvm namespace
index ba944cb8cc0a6250edab02b2926eeeada6aeee93..fd8289675a21290ddf8b2e54509a59834513b5e3 100644 (file)
@@ -11,6 +11,8 @@
 #include "llvm/Value.h"
 #include <iostream>
 
+namespace llvm {
+
 std::ostream &operator<<(std::ostream &O, RAV V) { // func to print a Value 
   const Value &v = V.V;
   if (v.hasName())
@@ -26,3 +28,4 @@ void printSet(const ValueSet &S) {
     std::cerr << RAV(*I);
 }
 
+} // End llvm namespace
index d421f3e971a72e727f7d09b1d7d06bd2a8d85236..9a08de79afab9ac6308706a60a969c07caf5b132 100644 (file)
@@ -28,6 +28,8 @@
 #include "Support/Annotation.h"
 #include <vector>
 
+namespace llvm {
+
 class MachineInstr;
 class Instruction;
 class Value;
@@ -96,4 +98,6 @@ public:
   CallArgsDescriptor* getCallArgsDescriptor() const    { return callArgsDesc; }
 };
 
+} // End llvm namespace
+
 #endif
index db7332227862b3a42f0de908a9ca126048bcf747..fdf135b16bb0ccc76fe54c0ac8a57a3b45fb0dc7 100644 (file)
@@ -17,6 +17,9 @@
 
 #include "Support/HashExtras.h"
 #include "Support/hash_set"
+
+namespace llvm {
+
 class MachineFunction;
 class Value;
 class Constant;
@@ -112,4 +115,6 @@ private:
   int allocateOptionalArg(const Type* type);
 };
 
+} // End llvm namespace
+
 #endif
index 98dde590b8d01d6417d46b90eafbf4da9e740235..19d93ab56ad3e70c8c492be9e7efabad27514133 100644 (file)
@@ -17,6 +17,8 @@
 #include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/Target/TargetRegInfo.h"
 
+namespace llvm {
+
 class Value;
 class TmpInstruction;
 class CallInst;
@@ -88,5 +90,6 @@ public:
   static CallArgsDescriptor *get(const MachineInstr* MI);
 };
 
+} // End llvm namespace
 
 #endif
index db03f13b976086b186ba13dcba4a535e88a9e741..2afde6bdf59d2df44a046d26e05cecb729f9f99d 100644 (file)
@@ -49,6 +49,8 @@
 #include "llvm/CodeGen/MachineCodeForInstruction.h"
 #include "Support/StringExtras.h"
 
+namespace llvm {
+
 namespace {
   class MappingInfoAsmPrinter : public FunctionPass { 
     std::ostream &Out;
@@ -293,3 +295,5 @@ bool MappingInfoAsmPrinter::doFinalization (Module &M) {
   return false;
 }
 
+} // End llvm namespace
+
index f86e2b42b7a6e0325a55419d5176ddee72ff030d..6af116a6da28bc97d0770522d0cff39364674ace 100644 (file)
@@ -18,6 +18,9 @@
 #include <iosfwd>
 #include <vector>
 #include <string>
+
+namespace llvm {
+
 class Pass;
 
 Pass *getMappingInfoAsmPrinterPass(std::ostream &out);
@@ -41,4 +44,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif
index 6318c5ab46f3e9db8222cf0e42e0ae0eff2bf7cf..8aaaa2b6b5cfce483700abb63fa71230d15b3532 100644 (file)
@@ -13,6 +13,8 @@
 #include "ModuloSchedGraph.h"
 #include "llvm/Type.h"
 
+namespace llvm {
+
 ModuloSchedGraphNode::ModuloSchedGraphNode(unsigned id, int index, 
                                           const Instruction *inst, 
                                           const TargetMachine &targ) 
@@ -135,3 +137,4 @@ ModuloSchedGraphSet::~ModuloSchedGraphSet(){
   //delete all the graphs
 }
 
+} // End llvm namespace
index 214e24cc8b5eca5c122ced03a0790347bb9a2653..552d699e768f8d8ef5debadacb7ffdf994bf78a9 100644 (file)
@@ -22,6 +22,7 @@
 #include "Support/hash_map"
 #include <vector>
 
+namespace llvm {
 
 class ModuloSchedGraphNode : public SchedGraphNodeCommon {
 
@@ -106,4 +107,6 @@ public:
 
 };
 
+} // End llvm namespace
+
 #endif
index 91ec6c28f55262d154632783a66625ecb6163c90..219d892d3143397bf117c62fb8fc00264405c6b0 100644 (file)
@@ -16,6 +16,8 @@
 #include "llvm/Function.h"
 #include "llvm/Pass.h"
 
+namespace llvm {
+
 namespace {
   
   class ModuloScheduling : public FunctionPass {
@@ -40,3 +42,5 @@ bool ModuloScheduling::runOnFunction(Function &F) {
   bool Changed = false;
   return Changed;
 }
+
+} // End llvm namespace
index f83f2103be7fbd43a5997c0d1da87f52364e3322..67f58a7ed04bc58127470aa69a5a7d39dc7e15a8 100644 (file)
@@ -19,6 +19,8 @@
 #include "llvm/DerivedTypes.h"
 #include "llvm/Constants.h"
 
+namespace llvm {
+
 /// AllocInfo - Structure representing one instruction's operand's-worth of
 /// register allocation state. We create tables made out of these data
 /// structures to generate mapping information for this register allocator.
@@ -77,4 +79,6 @@ struct AllocInfo {
   }
 };
 
+} // End llvm namespace
+
 #endif // ALLOCINFO_H
index f883fb13c1d211338fd4dc5dd8ae49d4bb672b69..a76fdeaa037009411f9a2344ccf4d5ae07908c92 100644 (file)
@@ -16,6 +16,8 @@
 #include <algorithm>
 #include <iostream>
 
+namespace llvm {
+
 //-----------------------------------------------------------------------------
 // Sets this IGNode on stack and reduce the degree of neighbors  
 //-----------------------------------------------------------------------------
@@ -56,3 +58,5 @@ IGNode::getCombinedDegree(const IGNode* otherNode) const {
   std::vector<IGNode*>::iterator new_end = unique(nbrs.begin(), nbrs.end());
   return new_end - nbrs.begin();
 }
+
+} // End llvm namespace
index 82f07e0c7e7449028f8f0650e2945a1c4cdae859..9fdc7a6ac07e84aef9aa5e9da986d458e653ca66 100644 (file)
@@ -32,6 +32,9 @@
 
 #include "LiveRange.h"
 #include <vector>
+
+namespace llvm {
+
 class RegClass;
 
 //----------------------------------------------------------------------------
@@ -115,4 +118,6 @@ public:
   inline LiveRange *getParentLR() const { return ParentLR; }
 };
 
+} // End llvm namespace
+
 #endif
index 392a96c11c622c2baaa4357f09ff5bdf5e120521..3cef19ea0e0539940c35c2598f9e5d2ed5cc5321 100644 (file)
@@ -17,6 +17,8 @@
 #include "Support/STLExtras.h"
 #include <algorithm>
 
+namespace llvm {
+
 // for asserting this IG node is infact in the IGNodeList of this class
 inline static void assertIGNode(const InterferenceGraph *IG,
                                 const IGNode *Node) {
@@ -246,3 +248,5 @@ void InterferenceGraph::printIGNodeList() const {
     }
   }
 }
+
+} // End llvm namespace
index 6b8cf3cd053b7ece3b91e10a4d5f45de58785ef6..79850c1fcf017e5e5b209c829a1bd5960ed5674c 100644 (file)
@@ -30,6 +30,9 @@
 #define INTERFERENCEGRAPH_H
 
 #include <vector>
+
+namespace llvm {
+
 class LiveRange;
 class RegClass;
 class IGNode;
@@ -67,4 +70,6 @@ class InterferenceGraph {
   void printIGNodeList() const;
 };
 
+} // End llvm namespace
+
 #endif
index aa409c63fbcc2fd508b7d849694e4369a7456f45..d6e2cf63072a9a274371622a1b2e8391782a2393 100644 (file)
@@ -21,6 +21,8 @@
 #include "llvm/Value.h"
 #include "llvm/CodeGen/ValueSet.h"
 
+namespace llvm {
+
 class RegClass;
 class IGNode;
 
@@ -177,4 +179,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif
index b9fcda789f78c7621990784b5f3ac18cc24270cc..9fd04d2b0e45e25c96fe486f34f2c7f10c7673c1 100644 (file)
@@ -23,6 +23,8 @@
 #include "llvm/Target/TargetRegInfo.h"
 #include "Support/SetOperations.h"
 
+namespace llvm {
+
 unsigned LiveRange::getRegClassID() const { return getRegClass()->getID(); }
 
 LiveRangeInfo::LiveRangeInfo(const Function *F, const TargetMachine &tm,
@@ -411,3 +413,5 @@ void LiveRangeInfo::printLiveRanges() {
     }
   }
 }
+
+} // End llvm namespace
index 5c5244bd62cfdd4c14da37a7589b3b8f5b8c9552..a8d0e7152f19f4cafa6cb466dcb6288a5207725e 100644 (file)
@@ -29,6 +29,8 @@
 #include "llvm/CodeGen/ValueSet.h"
 #include "Support/hash_map"
 
+namespace llvm {
+
 class LiveRange;
 class MachineInstr;
 class RegClass;
@@ -121,4 +123,6 @@ public:
   void printLiveRanges();
 };
 
+} // End llvm namespace
+
 #endif 
index 99917cdf0b46918d24a179a05e1871dd22e1640b..332ae9524cb40155980bde006940221ddc8be0af 100644 (file)
@@ -47,6 +47,8 @@
 #include "Support/STLExtras.h"
 #include <cmath>
 
+namespace llvm {
+
 RegAllocDebugLevel_t DEBUG_RA;
 
 /// The reoptimizer wants to be able to grovel through the register
@@ -1392,3 +1394,5 @@ bool PhyRegAlloc::runOnFunction (Function &F) {
   if (DEBUG_RA) std::cerr << "\nRegister allocation complete!\n"; 
   return false;     // Function was not modified
 } 
+
+} // End llvm namespace
index c524f9f56cbe569b15c303c6885fb01a452f6287..4ec083c8ea32df6ed42ac9a07d496bd278a8b12e 100644 (file)
@@ -31,6 +31,8 @@
 #include "llvm/Target/TargetRegInfo.h"
 #include <map>
 
+namespace llvm {
+
 class MachineFunction;
 class FunctionLiveVarInfo;
 class MachineInstr;
@@ -179,4 +181,6 @@ private:
   void addInterf4PseudoInstr(const MachineInstr *MI);
 };
 
+} // End llvm namespace
+
 #endif
index 97d102a253ab2134b5038f0fb7c8b09f4cc27ac6..7dd86b205af8cf1fe5b909fcc89b1aa6693b657c 100644 (file)
@@ -14,6 +14,8 @@
 #ifndef REGALLOCCOMMON_H
 #define REGALLOCCOMMON_H
 
+namespace llvm {
+
 enum RegAllocDebugLevel_t {
   RA_DEBUG_None         = 0,
   RA_DEBUG_Results      = 1,
@@ -25,4 +27,6 @@ enum RegAllocDebugLevel_t {
 
 extern RegAllocDebugLevel_t DEBUG_RA;
 
+} // End llvm namespace
+
 #endif
index 9c8603b82c3a366e2cf8f97620b4f590bdfd68c5..9af87ba0e86e9532a1fd5f640b05f553b3f198cf 100644 (file)
@@ -16,6 +16,8 @@
 #include "RegClass.h"
 #include "llvm/Target/TargetRegInfo.h"
 
+namespace llvm {
+
 //----------------------------------------------------------------------------
 // This constructor inits IG. The actual matrix is created by a call to 
 // createInterferenceGraph() above.
@@ -245,4 +247,4 @@ void RegClass::printIG() {
   IG.printIG(); 
 }
 
-
+} // End llvm namespace
index c861fbae210e48284cc2c86eed6e2635317ea8a6..0071f7c2129c34169fc516f94f4f7320ae378d64 100644 (file)
@@ -20,6 +20,9 @@
 #include "llvm/Target/TargetRegInfo.h"
 #include "InterferenceGraph.h"
 #include <stack>
+
+namespace llvm {
+
 class TargetRegClassInfo;
 
 
@@ -139,4 +142,6 @@ class RegClass {
   void printIG();
 };
 
+} // End llvm namespace
+
 #endif
index a5bc98fa8992ad40841e679238b1f7b2fea8fe04..38dc2439ce84236a35e53e462d784123adf658cf 100644 (file)
@@ -11,7 +11,7 @@
 Xinclude <cstdio>
 Xinclude <llvm/CodeGen/InstrForest.h>
 
-typedef InstrTreeNode* NODEPTR_TYPE;
+typedef llvm::InstrTreeNode* NODEPTR_TYPE;
 Xdefine OP_LABEL(p)    ((p)->opLabel)
 Xdefine LEFT_CHILD(p)  ((p)->LeftChild)
 Xdefine RIGHT_CHILD(p) ((p)->RightChild)
index 25034177da499c89c8e59597dd75f16a6542c291..6af9836e29b6a35ced2f962dbde5062e044c0273 100644 (file)
@@ -33,6 +33,8 @@
 #include "SparcInternals.h"
 #include <string>
 
+namespace llvm {
+
 namespace {
 
 Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed");
@@ -877,12 +879,13 @@ SparcFunctionAsmPrinter::emitFunction(const Function &F)
 
 }  // End anonymous namespace
 
+namespace llvm {
+
 Pass *UltraSparc::getFunctionAsmPrinterPass(std::ostream &Out) {
   return new SparcFunctionAsmPrinter(Out, *this);
 }
 
-
-
+} // End llvm namespace
 
 
 //===----------------------------------------------------------------------===//
@@ -954,3 +957,5 @@ void SparcModuleAsmPrinter::emitGlobals(const Module &M) {
 Pass *UltraSparc::getModuleAsmPrinterPass(std::ostream &Out) {
   return new SparcModuleAsmPrinter(Out, *this);
 }
+
+} // End llvm namespace
index d60d9151c1ce86d1a9acc2127725184202819d17..c50dca55e78a9295ce5c880b054b3755b54b0818 100644 (file)
@@ -38,6 +38,8 @@
 #include "SparcV9CodeEmitter.h"
 #include "Config/alloca.h"
 
+namespace llvm {
+
 namespace {
   Statistic<> OverwrittenCalls("call-ovwr", "Number of over-written calls");
   Statistic<> UnmodifiedCalls("call-skip", "Number of unmodified calls");
@@ -443,7 +445,6 @@ uint64_t JITResolver::emitStubForFunction(Function *F) {
   return (intptr_t)MCE.finishFunctionStub(*F)+4; /* 1 instr past the restore */
 }
 
-
 SparcV9CodeEmitter::SparcV9CodeEmitter(TargetMachine &tm,
                                        MachineCodeEmitter &M): TM(tm), MCE(M)
 {
@@ -809,4 +810,6 @@ void* SparcV9CodeEmitter::getGlobalAddress(GlobalValue *V, MachineInstr &MI,
   }
 }
 
+} // End llvm namespace
+
 #include "SparcV9CodeEmitter.inc"
index 7e19c44ce03f4e6aad0bd1b9ed66020cd0e6831c..d21345ec041b03ee50b22eaba0e0c216a39c72c1 100644 (file)
@@ -19,6 +19,8 @@
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/Target/TargetMachine.h"
 
+namespace llvm {
+
 class GlobalValue;
 class MachineInstr;
 class MachineOperand;
@@ -81,4 +83,6 @@ private:
 
 };
 
+} // End llvm namespace
+
 #endif
index d92e3be9ca2644d44c05cf76c6f89a5c6b727ae9..11b0c7beab58433b4ac82faf0128ec323199f42c 100644 (file)
@@ -23,6 +23,8 @@
 #include "llvm/CodeGen/MachineCodeForInstruction.h"
 #include "llvm/CodeGen/MachineInstrBuilder.h"
 
+namespace llvm {
+
 static const uint32_t MAXLO   = (1 << 10) - 1; // set bits set by %lo(*)
 static const uint32_t MAXSIMM = (1 << 12) - 1; // set bits in simm13 field of OR
 
@@ -792,3 +794,5 @@ UltraSparcInstrInfo::CreateZeroExtensionInstructions(
   CreateBitExtensionInstructions(/*signExtend*/ false, target, F, srcVal,
                                  destVal, numLowBits, mvec, mcfi);
 }
+
+} // End llvm namespace
index b377658b9c8113717365c23ed5e2193d49021e60..21e884be8e1b418bbe5d502ea0dd8a42efac5893 100644 (file)
@@ -32,6 +32,8 @@
 #include <algorithm>
 #include <cmath>
 
+namespace llvm {
+
 static inline void Add3OperandInstr(unsigned Opcode, InstructionNode* Node,
                                     std::vector<MachineInstr*>& mvec) {
   mvec.push_back(BuildMI(Opcode, 3).addReg(Node->leftChild()->getValue())
@@ -1390,12 +1392,12 @@ AllUsesAreBranches(const Instruction* setccI)
 // instead of a regular call.  If not that kind of intrinsic, do nothing.
 // Returns true if code was generated, otherwise false.
 // 
-bool CodeGenIntrinsic(LLVMIntrinsic::ID iid, CallInst &callInstr,
+bool CodeGenIntrinsic(Intrinsic::ID iid, CallInst &callInstr,
                       TargetMachine &target,
                       std::vector<MachineInstr*>& mvec)
 {
   switch (iid) {
-  case LLVMIntrinsic::va_start: {
+  case Intrinsic::va_start: {
     // Get the address of the first incoming vararg argument on the stack
     bool ignore;
     Function* func = cast<Function>(callInstr.getParent()->getParent());
@@ -1409,10 +1411,10 @@ bool CodeGenIntrinsic(LLVMIntrinsic::ID iid, CallInst &callInstr,
     return true;
   }
 
-  case LLVMIntrinsic::va_end:
+  case Intrinsic::va_end:
     return true;                        // no-op on Sparc
 
-  case LLVMIntrinsic::va_copy:
+  case Intrinsic::va_copy:
     // Simple copy of current va_list (arg1) to new va_list (result)
     mvec.push_back(BuildMI(V9::ORr, 3).
                    addMReg(target.getRegInfo().getZeroRegNum()).
@@ -1420,8 +1422,8 @@ bool CodeGenIntrinsic(LLVMIntrinsic::ID iid, CallInst &callInstr,
                    addRegDef(&callInstr));
     return true;
 
-  case LLVMIntrinsic::sigsetjmp:
-  case LLVMIntrinsic::setjmp: {
+  case Intrinsic::sigsetjmp:
+  case Intrinsic::setjmp: {
     // act as if we return 0
     unsigned g0 = target.getRegInfo().getZeroRegNum();
     mvec.push_back(BuildMI(V9::ORr,3).addMReg(g0).addMReg(g0)
@@ -1429,8 +1431,8 @@ bool CodeGenIntrinsic(LLVMIntrinsic::ID iid, CallInst &callInstr,
     return true;
   }
 
-  case LLVMIntrinsic::siglongjmp:
-  case LLVMIntrinsic::longjmp: {
+  case Intrinsic::siglongjmp:
+  case Intrinsic::longjmp: {
     // call abort()
     Module* M = callInstr.getParent()->getParent()->getParent();
     const FunctionType *voidvoidFuncTy =
@@ -2474,8 +2476,8 @@ GetInstructionsByRule(InstructionNode* subtreeRoot,
         // sequence (e.g., va_start).  Indirect calls cannot be special.
         // 
         bool specialIntrinsic = false;
-        LLVMIntrinsic::ID iid;
-        if (calledFunc && (iid=(LLVMIntrinsic::ID)calledFunc->getIntrinsicID()))
+        Intrinsic::ID iid;
+        if (calledFunc && (iid=(Intrinsic::ID)calledFunc->getIntrinsicID()))
           specialIntrinsic = CodeGenIntrinsic(iid, *callInstr, target, mvec);
 
         // If not, generate the normal call sequence for the function.
@@ -2929,3 +2931,5 @@ GetInstructionsByRule(InstructionNode* subtreeRoot,
     }
   }
 }
+
+}
index d49863c1c84a72a09af53d048a051399227612f4..b69c5c2b6e46d51736f6efe1a42b938d21ae607f 100644 (file)
@@ -17,6 +17,8 @@
 #include "llvm/DerivedTypes.h"
 #include "SparcInternals.h"
 
+namespace llvm {
+
 // Choose load instruction opcode based on type of value
 inline MachineOpCode
 ChooseLoadInstruction(const Type *DestTy)
@@ -220,4 +222,6 @@ convertOpcodeFromRegToImm(unsigned Opcode) {
   }
 }
 
+} // End llvm namespace
+
 #endif
index 4d0a48e4d5d8c9e40029664d862600127e6a6a19..5e5f155e399d7fcafb13ac1d1f72d58835cb0e0b 100644 (file)
@@ -25,6 +25,8 @@
 #include "SparcRegClassInfo.h"
 #include "Config/sys/types.h"
 
+namespace llvm {
+
 class LiveRange;
 class UltraSparc;
 class Pass;
@@ -693,4 +695,6 @@ public:
   Pass* getBytecodeAsmPrinterPass(std::ostream &Out);
 };
 
+} // End llvm namespace
+
 #endif
index 83081b71203e63543918ef20c031d483a35fb1cc..9713a02d95e9d02e9d7c9076ecccfe081e201fce 100644 (file)
@@ -20,6 +20,8 @@
 #include "llvm/BasicBlock.h"
 #include "llvm/Pass.h"
 
+namespace llvm {
+
 //************************* Internal Functions *****************************/
 
 static inline void
@@ -163,3 +165,5 @@ bool PeepholeOpts::runOnBasicBlock(BasicBlock &BB) {
 FunctionPass* createPeepholeOptsPass(const TargetMachine &TM) {
   return new PeepholeOpts(TM);
 }
+
+} // End llvm namespace
index 9078dc13b1e78b9179ffca776c097fc3b7440166..205ecd3145ce59fa9dbb8a16bf659d5d62ab5621 100644 (file)
@@ -29,6 +29,8 @@
 #include "llvm/Transforms/Scalar.h"
 #include <algorithm>
 
+namespace llvm {
+
 namespace {
 
   //===--------------------------------------------------------------------===//
@@ -71,6 +73,7 @@ namespace {
                                "Specialize LLVM code for a target machine"
                                createPreselectionPass);
 #endif
+
 }  // end anonymous namespace
 
 
@@ -236,7 +239,6 @@ void PreSelection::visitCallInst(CallInst &I) {
   visitOperands(I, (/*firstOp=*/ I.getCalledFunction()? 1 : 0));
 }
 
-
 //===----------------------------------------------------------------------===//
 // createPreSelectionPass - Public entrypoint for pre-selection pass
 // and this file as a whole...
@@ -244,3 +246,5 @@ void PreSelection::visitCallInst(CallInst &I) {
 FunctionPass* createPreSelectionPass(const TargetMachine &TM) {
   return new PreSelection(TM);
 }
+
+} // End llvm namespace
index ff7bd7d02693a4209d761dcb420c3b604d11c3e9..555b6b14fe7a9ba9d221d587d50b64fcfa364ee4 100644 (file)
@@ -27,6 +27,8 @@
 #include "llvm/DerivedTypes.h"
 #include "llvm/Intrinsics.h"
 
+namespace llvm {
+
 namespace {
   struct InsertPrologEpilogCode : public MachineFunctionPass {
     const char *getPassName() const { return "Sparc Prolog/Epilog Inserter"; }
@@ -177,3 +179,5 @@ void InsertPrologEpilogCode::InsertEpilogCode(MachineFunction &MF)
 FunctionPass *UltraSparc::getPrologEpilogInsertionPass() {
   return new InsertPrologEpilogCode();
 }
+
+} // End llvm namespace
index d6de5f9c0df27184e5459607e5a74b62199be873..564e59cd70ec1d52238f0bd3eab1070c234b16ab 100644 (file)
@@ -17,6 +17,8 @@
 #include "../../CodeGen/RegAlloc/RegAllocCommon.h"   // FIXME!
 #include "../../CodeGen/RegAlloc/IGNode.h"           // FIXME!
 
+namespace llvm {
+
 //-----------------------------------------------------------------------------
 // Int Register Class - method for coloring a node in the interference graph.
 //
@@ -390,3 +392,5 @@ int SparcFloatRegClass::findFloatColor(const LiveRange *LR,
   return -1;
 
 }
+
+} // End llvm namespace
index 321ce60ab0f27d9803688047cedf02e3e53986bb..cc492e77c72c4b1089cfe7bad56ba66f66c05931 100644 (file)
@@ -16,6 +16,8 @@
 
 #include "llvm/Target/TargetRegInfo.h"
 
+namespace llvm {
+
 //-----------------------------------------------------------------------------
 // Integer Register Class
 //-----------------------------------------------------------------------------
@@ -217,4 +219,6 @@ struct SparcSpecialRegClass : public TargetRegClassInfo {
   const char * const getRegName(unsigned reg) const;
 };
 
+} // End llvm namespace
+
 #endif
index 84dc92e246d2a241784a205632e48358a5c9fcd9..5edbbe06470f3386dd2f9dd93c2d2a50776f6fd3 100644 (file)
@@ -27,6 +27,8 @@
 #include "llvm/Function.h"
 #include "llvm/DerivedTypes.h"
 
+namespace llvm {
+
 enum {
   BadRegClass = ~0
 };
@@ -967,3 +969,5 @@ void UltraSparcRegInfo::printReg(const LiveRange *LR) const {
     std::cerr << "+" << getUnifiedRegName(uRegName+1);
   std::cerr << "]\n";
 }
+
+} // End llvm namespace
index fd03ad69d679379ed46b65961629085bfef9c69f..7d8ea05066c231a8f058471029832b1a0eda40ae 100644 (file)
@@ -13,6 +13,8 @@
 
 #include "SparcInternals.h"
 
+using namespace llvm;
+
 /*---------------------------------------------------------------------------
 Scheduling guidelines for SPARC IIi:
 
index 551dd92b49568889ad3e777282f829960de6f15a..5fd0ba192713223559173c6f425aa600607a2fd9 100644 (file)
@@ -20,6 +20,8 @@
 #include "llvm/CodeGen/MachineFunctionInfo.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
 
+namespace llvm {
+
 namespace {
   class StackSlots : public MachineFunctionPass {
     const TargetMachine &Target;
@@ -48,3 +50,5 @@ namespace {
 Pass *createStackSlotsPass(const TargetMachine &Target) {
   return new StackSlots(Target);
 }
+
+} // End llvm namespace
index d20fc758d0df0b7f8d28aed74a9d756b60b16148..73f2fd81395e19ef82f2451544ca3f2cf2c9f96d 100644 (file)
@@ -27,6 +27,8 @@
 #include "llvm/Target/TargetMachineImpls.h"
 #include "Support/CommandLine.h"
 
+namespace llvm {
+
 static const unsigned ImplicitRegUseList[] = { 0 }; /* not used yet */
 // Build the MachineInstruction Description Array...
 const TargetInstrDescriptor SparcMachineInstrDesc[] = {
@@ -267,3 +269,5 @@ bool UltraSparc::addPassesToJITCompile(FunctionPassManager &PM) {
 
   return false; // success!
 }
+
+} // End llvm namespace
index a377fd0d7f945b3a830d41af41fc9078ce6549f7..ed6936dd1223c75313227feb656fb5f15e055997 100644 (file)
 #include "llvm/DerivedTypes.h"
 #include "llvm/Constants.h"
 
+namespace llvm {
+
 // Handle the Pass registration stuff necessary to use TargetData's.
 namespace {
   // Register the default SparcV9 implementation...
   RegisterPass<TargetData> X("targetdata", "Target Data Layout");
 }
 
-
 static inline void getTypeInfo(const Type *Ty, const TargetData *TD,
                               uint64_t &Size, unsigned char &Alignment);
 
@@ -221,3 +222,5 @@ uint64_t TargetData::getIndexedOffset(const Type *ptrTy,
 
   return Result;
 }
+
+} // End llvm namespace
index f377d67b66f7606be0ee3c2fb0709ba027756010..0f9015f8a60d2120d559ac6444bb6deeb5a6f755 100644 (file)
@@ -15,6 +15,8 @@
 #include "llvm/Constant.h"
 #include "llvm/DerivedTypes.h"
 
+namespace llvm {
+
 // External object describing the machine instructions
 // Initialized only when the TargetMachine class is created
 // and reset when that class is destroyed.
@@ -59,3 +61,5 @@ bool TargetInstrInfo::ConstantTypeMustBeLoaded(const Constant* CV) const {
   assert(CV->getType()->isPrimitiveType() || isa<PointerType>(CV->getType()));
   return !(CV->getType()->isIntegral() || isa<PointerType>(CV->getType()));
 }
+
+} // End llvm namespace
index b7c1b342e1263c1c3f5f8d5073279dba5c6a607c..e7630b4ab34660320601ba92ad2a373c8f397730 100644 (file)
@@ -16,6 +16,8 @@
 #include "llvm/Target/TargetCacheInfo.h"
 #include "llvm/Type.h"
 
+namespace llvm {
+
 //---------------------------------------------------------------------------
 // class TargetMachine
 // 
@@ -49,3 +51,5 @@ void TargetCacheInfo::Initialize() {
   cacheSizes.push_back(1 << 15); cacheSizes.push_back(1 << 20);
   cacheAssoc.push_back(1);       cacheAssoc.push_back(4);
 }
+
+} // End llvm namespace
index 0dbde45c38ef6e4815c83edc1c88deb2eb434fd5..f33223c43a6805817896838ac75c8a70a7c61570 100644 (file)
@@ -15,6 +15,8 @@
 #include "llvm/Target/TargetSchedInfo.h"
 #include "llvm/Target/TargetMachine.h"
 
+namespace llvm {
+
 resourceId_t MachineResource::nextId = 0;
 
 // Check if fromRVec and toRVec have *any* common entries.
@@ -249,3 +251,5 @@ void InstrRUsage::addUsageDelta(const InstrRUsageDelta &delta) {
       assert(r >= 0 && "Resource to remove was unused in cycle c!");
     }
 }
+
+} // End llvm namespace
index 07e58ba171cc3c2a24319bce3d86144db982ce3a..5c6e6ebfddec041c301587ceb97b6980aef99ccd 100644 (file)
@@ -25,6 +25,8 @@
 #include <algorithm>
 #include <iostream>
 
+namespace llvm {
+
 namespace {
   Statistic<> NumFXCH("x86-codegen", "Number of fxch instructions inserted");
   Statistic<> NumFP  ("x86-codegen", "Number of floating point instructions");
@@ -70,7 +72,7 @@ namespace {
     // getSTReg - Return the X86::ST(i) register which contains the specified
     // FP<RegNo> register
     unsigned getSTReg(unsigned RegNo) const {
-      return StackTop - 1 - getSlot(RegNo) + X86::ST0;
+      return StackTop - 1 - getSlot(RegNo) + llvm::X86::ST0;
     }
 
     // pushReg - Push the specifiex FP<n> register onto the stack
@@ -598,3 +600,5 @@ void FPS::handleSpecialFP(MachineBasicBlock::iterator &I) {
 
   I = MBB->erase(I)-1;  // Remove the pseudo instruction
 }
+
+} // End llvm namespace
index 434ceee91c66463d85f6434780a9610df3462520..e5182945646f98a3da5ea4a33047b4441c73b138 100644 (file)
@@ -28,6 +28,8 @@
 // Include the generated instruction selector...
 #include "X86GenInstrSelector.inc"
 
+namespace llvm {
+
 namespace {
   struct ISel : public FunctionPass, SelectionDAGTargetBuilder {
     TargetMachine &TM;
@@ -114,7 +116,6 @@ void ISel::expandCall(SelectionDAG &SD, CallInst &CI) {
   assert(0 && "ISel::expandCall not implemented!");
 }
 
-
 /// createX86PatternInstructionSelector - This pass converts an LLVM function
 /// into a machine code representation using pattern matching and a machine
 /// description file.
@@ -122,3 +123,5 @@ void ISel::expandCall(SelectionDAG &SD, CallInst &CI) {
 FunctionPass *createX86PatternInstructionSelector(TargetMachine &TM) {
   return new ISel(TM);  
 }
+
+} // End llvm namespace
index 1242545d83a3a623837920be3d3dde8c4029f675..de341c477dce4d814a382c0c5d01ecfd28989647 100644 (file)
@@ -29,6 +29,8 @@
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Support/InstVisitor.h"
 
+namespace llvm {
+
 /// BMI - A special BuildMI variant that takes an iterator to insert the
 /// instruction at as well as a basic block.  This is the version for when you
 /// have a destination register in mind.
@@ -138,7 +140,7 @@ namespace {
     void doCall(const ValueRecord &Ret, MachineInstr *CallMI,
                 const std::vector<ValueRecord> &Args);
     void visitCallInst(CallInst &I);
-    void visitIntrinsicCall(LLVMIntrinsic::ID ID, CallInst &I);
+    void visitIntrinsicCall(Intrinsic::ID ID, CallInst &I);
 
     // Arithmetic operators
     void visitSimpleBinary(BinaryOperator &B, unsigned OpcodeClass);
@@ -1045,7 +1047,7 @@ void ISel::visitCallInst(CallInst &CI) {
   MachineInstr *TheCall;
   if (Function *F = CI.getCalledFunction()) {
     // Is it an intrinsic function call?
-    if (LLVMIntrinsic::ID ID = (LLVMIntrinsic::ID)F->getIntrinsicID()) {
+    if (Intrinsic::ID ID = (Intrinsic::ID)F->getIntrinsicID()) {
       visitIntrinsicCall(ID, CI);   // Special intrinsics are not handled here
       return;
     }
@@ -1066,29 +1068,29 @@ void ISel::visitCallInst(CallInst &CI) {
 }         
 
 
-void ISel::visitIntrinsicCall(LLVMIntrinsic::ID ID, CallInst &CI) {
+void ISel::visitIntrinsicCall(Intrinsic::ID ID, CallInst &CI) {
   unsigned TmpReg1, TmpReg2;
   switch (ID) {
-  case LLVMIntrinsic::va_start:
+  case Intrinsic::va_start:
     // Get the address of the first vararg value...
     TmpReg1 = getReg(CI);
     addFrameReference(BuildMI(BB, X86::LEAr32, 5, TmpReg1), VarArgsFrameIndex);
     return;
 
-  case LLVMIntrinsic::va_copy:
+  case Intrinsic::va_copy:
     TmpReg1 = getReg(CI);
     TmpReg2 = getReg(CI.getOperand(1));
     BuildMI(BB, X86::MOVrr32, 1, TmpReg1).addReg(TmpReg2);
     return;
-  case LLVMIntrinsic::va_end: return;   // Noop on X86
+  case Intrinsic::va_end: return;   // Noop on X86
 
-  case LLVMIntrinsic::longjmp:
-  case LLVMIntrinsic::siglongjmp:
+  case Intrinsic::longjmp:
+  case Intrinsic::siglongjmp:
     BuildMI(BB, X86::CALLpcrel32, 1).addExternalSymbol("abort", true); 
     return;
 
-  case LLVMIntrinsic::setjmp:
-  case LLVMIntrinsic::sigsetjmp:
+  case Intrinsic::setjmp:
+  case Intrinsic::sigsetjmp:
     // Setjmp always returns zero...
     BuildMI(BB, X86::MOVir32, 1, getReg(CI)).addZImm(0);
     return;
@@ -2127,7 +2129,6 @@ void ISel::visitFreeInst(FreeInst &I) {
   doCall(ValueRecord(0, Type::VoidTy), TheCall, Args);
 }
    
-
 /// createX86SimpleInstructionSelector - This pass converts an LLVM function
 /// into a machine code representation is a very simple peep-hole fashion.  The
 /// generated code sucks but the implementation is nice and simple.
@@ -2135,3 +2136,5 @@ void ISel::visitFreeInst(FreeInst &I) {
 FunctionPass *createX86SimpleInstructionSelector(TargetMachine &TM) {
   return new ISel(TM);
 }
+
+} // End llvm namespace
index fbc84f7e8711e52ef957163182658d94382fa884..2f3280a4bbbb87fdaff701729e05f84579384618 100644 (file)
@@ -15,6 +15,8 @@
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/CodeGen/MachineInstrBuilder.h"
 
+namespace llvm {
+
 namespace {
   struct PH : public MachineFunctionPass {
     virtual bool runOnMachineFunction(MachineFunction &MF);
@@ -131,3 +133,5 @@ bool PH::PeepholeOptimize(MachineBasicBlock &MBB,
     return false;
   }
 }
+
+} // End llvm namespace
index 3d073f77c65901db3130e5894a6bf9786a51ad3a..292a465e725e69c30c0db689d38f90ce9b1217ef 100644 (file)
@@ -29,6 +29,8 @@
 #include "Support/StringExtras.h"
 #include "Support/CommandLine.h"
 
+namespace llvm {
+
 namespace {
   Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed");
 
@@ -960,3 +962,5 @@ bool Printer::doFinalization(Module &M) {
   delete Mang;
   return false; // success
 }
+
+} // End llvm namespace
index 01041f8d3a8012f0ca2876e6c1a2885bb9f15889..5cf897fa7156d0959188d6c981f2a5f0c061a97c 100644 (file)
@@ -16,6 +16,9 @@
 #define TARGET_X86_H
 
 #include <iosfwd>
+
+namespace llvm {
+
 class TargetMachine;
 class FunctionPass;
 
@@ -58,6 +61,8 @@ FunctionPass *createEmitX86CodeToMemory();
 // Defines symbolic names for X86 registers.  This defines a mapping from
 // register name to register number.
 //
+} // End llvm namespace
+
 #include "X86GenRegisterNames.inc"
 
 // Defines symbolic names for the X86 instructions.
index 3d073f77c65901db3130e5894a6bf9786a51ad3a..292a465e725e69c30c0db689d38f90ce9b1217ef 100644 (file)
@@ -29,6 +29,8 @@
 #include "Support/StringExtras.h"
 #include "Support/CommandLine.h"
 
+namespace llvm {
+
 namespace {
   Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed");
 
@@ -960,3 +962,5 @@ bool Printer::doFinalization(Module &M) {
   delete Mang;
   return false; // success
 }
+
+} // End llvm namespace
index f49fde58d205da5c13b0d8580b573fc52f1c670e..e24e2904b51e957b57ed18e23577208e8663a299 100644 (file)
@@ -24,6 +24,8 @@
 #include "Support/Statistic.h"
 #include "Config/alloca.h"
 
+namespace llvm {
+
 namespace {
   Statistic<>
   NumEmitted("x86-emitter", "Number of machine instructions emitted");
@@ -589,3 +591,5 @@ void Emitter::emitInstruction(MachineInstr &MI) {
     break;
   }
 }
+
+} // End llvm namespace
index 07e58ba171cc3c2a24319bce3d86144db982ce3a..5c6e6ebfddec041c301587ceb97b6980aef99ccd 100644 (file)
@@ -25,6 +25,8 @@
 #include <algorithm>
 #include <iostream>
 
+namespace llvm {
+
 namespace {
   Statistic<> NumFXCH("x86-codegen", "Number of fxch instructions inserted");
   Statistic<> NumFP  ("x86-codegen", "Number of floating point instructions");
@@ -70,7 +72,7 @@ namespace {
     // getSTReg - Return the X86::ST(i) register which contains the specified
     // FP<RegNo> register
     unsigned getSTReg(unsigned RegNo) const {
-      return StackTop - 1 - getSlot(RegNo) + X86::ST0;
+      return StackTop - 1 - getSlot(RegNo) + llvm::X86::ST0;
     }
 
     // pushReg - Push the specifiex FP<n> register onto the stack
@@ -598,3 +600,5 @@ void FPS::handleSpecialFP(MachineBasicBlock::iterator &I) {
 
   I = MBB->erase(I)-1;  // Remove the pseudo instruction
 }
+
+} // End llvm namespace
index 434ceee91c66463d85f6434780a9610df3462520..e5182945646f98a3da5ea4a33047b4441c73b138 100644 (file)
@@ -28,6 +28,8 @@
 // Include the generated instruction selector...
 #include "X86GenInstrSelector.inc"
 
+namespace llvm {
+
 namespace {
   struct ISel : public FunctionPass, SelectionDAGTargetBuilder {
     TargetMachine &TM;
@@ -114,7 +116,6 @@ void ISel::expandCall(SelectionDAG &SD, CallInst &CI) {
   assert(0 && "ISel::expandCall not implemented!");
 }
 
-
 /// createX86PatternInstructionSelector - This pass converts an LLVM function
 /// into a machine code representation using pattern matching and a machine
 /// description file.
@@ -122,3 +123,5 @@ void ISel::expandCall(SelectionDAG &SD, CallInst &CI) {
 FunctionPass *createX86PatternInstructionSelector(TargetMachine &TM) {
   return new ISel(TM);  
 }
+
+} // End llvm namespace
index 1242545d83a3a623837920be3d3dde8c4029f675..de341c477dce4d814a382c0c5d01ecfd28989647 100644 (file)
@@ -29,6 +29,8 @@
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Support/InstVisitor.h"
 
+namespace llvm {
+
 /// BMI - A special BuildMI variant that takes an iterator to insert the
 /// instruction at as well as a basic block.  This is the version for when you
 /// have a destination register in mind.
@@ -138,7 +140,7 @@ namespace {
     void doCall(const ValueRecord &Ret, MachineInstr *CallMI,
                 const std::vector<ValueRecord> &Args);
     void visitCallInst(CallInst &I);
-    void visitIntrinsicCall(LLVMIntrinsic::ID ID, CallInst &I);
+    void visitIntrinsicCall(Intrinsic::ID ID, CallInst &I);
 
     // Arithmetic operators
     void visitSimpleBinary(BinaryOperator &B, unsigned OpcodeClass);
@@ -1045,7 +1047,7 @@ void ISel::visitCallInst(CallInst &CI) {
   MachineInstr *TheCall;
   if (Function *F = CI.getCalledFunction()) {
     // Is it an intrinsic function call?
-    if (LLVMIntrinsic::ID ID = (LLVMIntrinsic::ID)F->getIntrinsicID()) {
+    if (Intrinsic::ID ID = (Intrinsic::ID)F->getIntrinsicID()) {
       visitIntrinsicCall(ID, CI);   // Special intrinsics are not handled here
       return;
     }
@@ -1066,29 +1068,29 @@ void ISel::visitCallInst(CallInst &CI) {
 }         
 
 
-void ISel::visitIntrinsicCall(LLVMIntrinsic::ID ID, CallInst &CI) {
+void ISel::visitIntrinsicCall(Intrinsic::ID ID, CallInst &CI) {
   unsigned TmpReg1, TmpReg2;
   switch (ID) {
-  case LLVMIntrinsic::va_start:
+  case Intrinsic::va_start:
     // Get the address of the first vararg value...
     TmpReg1 = getReg(CI);
     addFrameReference(BuildMI(BB, X86::LEAr32, 5, TmpReg1), VarArgsFrameIndex);
     return;
 
-  case LLVMIntrinsic::va_copy:
+  case Intrinsic::va_copy:
     TmpReg1 = getReg(CI);
     TmpReg2 = getReg(CI.getOperand(1));
     BuildMI(BB, X86::MOVrr32, 1, TmpReg1).addReg(TmpReg2);
     return;
-  case LLVMIntrinsic::va_end: return;   // Noop on X86
+  case Intrinsic::va_end: return;   // Noop on X86
 
-  case LLVMIntrinsic::longjmp:
-  case LLVMIntrinsic::siglongjmp:
+  case Intrinsic::longjmp:
+  case Intrinsic::siglongjmp:
     BuildMI(BB, X86::CALLpcrel32, 1).addExternalSymbol("abort", true); 
     return;
 
-  case LLVMIntrinsic::setjmp:
-  case LLVMIntrinsic::sigsetjmp:
+  case Intrinsic::setjmp:
+  case Intrinsic::sigsetjmp:
     // Setjmp always returns zero...
     BuildMI(BB, X86::MOVir32, 1, getReg(CI)).addZImm(0);
     return;
@@ -2127,7 +2129,6 @@ void ISel::visitFreeInst(FreeInst &I) {
   doCall(ValueRecord(0, Type::VoidTy), TheCall, Args);
 }
    
-
 /// createX86SimpleInstructionSelector - This pass converts an LLVM function
 /// into a machine code representation is a very simple peep-hole fashion.  The
 /// generated code sucks but the implementation is nice and simple.
@@ -2135,3 +2136,5 @@ void ISel::visitFreeInst(FreeInst &I) {
 FunctionPass *createX86SimpleInstructionSelector(TargetMachine &TM) {
   return new ISel(TM);
 }
+
+} // End llvm namespace
index a6d65d47495cac2df9d4d0ce7ad44f0290fbce87..a5643bdbfb6eb2ed8be20e0c7303308c2b1727ff 100644 (file)
@@ -26,6 +26,8 @@
 
 #include "llvm/CodeGen/MachineInstrBuilder.h"
 
+namespace llvm {
+
 /// addDirectMem - This function is used to add a direct memory reference to the
 /// current instruction -- that is, a dereference of an address in a register,
 /// with no scale, index or displacement. An example is: DWORD PTR [EAX].
@@ -69,4 +71,6 @@ addConstantPoolReference(const MachineInstrBuilder &MIB, unsigned CPI,
   return MIB.addConstantPoolIndex(CPI).addZImm(1).addReg(0).addSImm(Offset);
 }
 
+} // End llvm namespace
+
 #endif
index 012ceadff0b714ed16b396745faa55c36d594e39..681bf023d990f4c3f1a107f36c3f065db353ab7a 100644 (file)
@@ -17,6 +17,8 @@
 
 #include "X86GenInstrInfo.inc"
 
+using namespace llvm;
+
 X86InstrInfo::X86InstrInfo()
   : TargetInstrInfo(X86Insts, sizeof(X86Insts)/sizeof(X86Insts[0]), 0) {
 }
index 26b2618a01f57013c578b98df352bdeca3527071..2bf82d16c63865f025c32744ed7692ddcec27aeb 100644 (file)
@@ -17,6 +17,8 @@
 #include "llvm/Target/TargetInstrInfo.h"
 #include "X86RegisterInfo.h"
 
+namespace llvm {
+
 /// X86II - This namespace holds all of the target specific flags that
 /// instruction info tracks.
 ///
@@ -181,4 +183,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif
index fbc84f7e8711e52ef957163182658d94382fa884..2f3280a4bbbb87fdaff701729e05f84579384618 100644 (file)
@@ -15,6 +15,8 @@
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/CodeGen/MachineInstrBuilder.h"
 
+namespace llvm {
+
 namespace {
   struct PH : public MachineFunctionPass {
     virtual bool runOnMachineFunction(MachineFunction &MF);
@@ -131,3 +133,5 @@ bool PH::PeepholeOptimize(MachineBasicBlock &MBB,
     return false;
   }
 }
+
+} // End llvm namespace
index fd8a615e3162689dc9f87a831e43cd63e7d5afb7..0e8b889ad8d31e25b7acb13ad0dcaf651f81f29c 100644 (file)
@@ -25,6 +25,8 @@
 #include "llvm/Target/TargetFrameInfo.h"
 #include "Support/CommandLine.h"
 
+namespace llvm {
+
 namespace {
   cl::opt<bool>
   NoFPElim("disable-fp-elim",
@@ -253,8 +255,12 @@ int X86RegisterInfo::emitEpilogue(MachineFunction &MF,
   return MBB.size() - oldSize;
 }
 
+} // End llvm namespace
+
 #include "X86GenRegisterInfo.inc"
 
+namespace llvm {
+
 const TargetRegisterClass*
 X86RegisterInfo::getRegClassForType(const Type* Ty) const {
   switch (Ty->getPrimitiveID()) {
@@ -274,3 +280,5 @@ X86RegisterInfo::getRegClassForType(const Type* Ty) const {
   case Type::DoubleTyID: return &RFPInstance;
   }
 }
+
+} // End llvm namespace
index 0db8e18bee183fb5d60752094364fbd68f8924f3..77a8a1a405329ae7b2bbc815e62b0d0a3b777339 100644 (file)
 
 #include "llvm/Target/MRegisterInfo.h"
 
-class Type;
+class llvm::Type;
 
 #include "X86GenRegisterInfo.h.inc"
 
+namespace llvm {
+
 struct X86RegisterInfo : public X86GenRegisterInfo {
   X86RegisterInfo();
   const TargetRegisterClass* getRegClassForType(const Type* Ty) const;
@@ -52,4 +54,6 @@ struct X86RegisterInfo : public X86GenRegisterInfo {
   int emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
 };
 
+} // End llvm namespace
+
 #endif
index 954d4f4ced6c1cba911f7c5bca7e541d5643d79b..31eb4bd61c2df62a391cc78a58719e9402331205 100644 (file)
@@ -22,6 +22,8 @@
 #include "Support/CommandLine.h"
 #include "Support/Statistic.h"
 
+namespace llvm {
+
 namespace {
   cl::opt<bool> PrintCode("print-machineinstrs",
                          cl::desc("Print generated machine code"));
@@ -153,3 +155,5 @@ void X86TargetMachine::replaceMachineCodeForFunction (void *Old, void *New) {
   int32_t OldAddr = (intptr_t) OldWord;
   *OldWord = NewAddr - OldAddr - 4; // Emit PC-relative addr of New code.
 }
+
+} // End llvm namespace
index 5581da4d8183b74cfd6d525a1b5e96d656837040..12f5c0e6a22ba17aa36d37a0a7731b7c2590f907 100644 (file)
@@ -19,6 +19,8 @@
 #include "llvm/PassManager.h"
 #include "X86InstrInfo.h"
 
+namespace llvm {
+
 class X86TargetMachine : public TargetMachine {
   X86InstrInfo InstrInfo;
   TargetFrameInfo FrameInfo;
@@ -55,4 +57,6 @@ public:
   virtual void replaceMachineCodeForFunction (void *Old, void *New);
 };
 
+} // End llvm namespace
+
 #endif
index d3e9287de47f1438740d3ab3b374dbeef8d1af05..970be52aa418e0a63e06a78aeb870151f2e52226 100644 (file)
@@ -23,6 +23,8 @@
 #include "Support/Debug.h"
 #include <algorithm>
 
+namespace llvm {
+
 static bool OperandConvertibleToType(User *U, Value *V, const Type *Ty,
                                      ValueTypeCache &ConvertedTypes,
                                      const TargetData &TD);
@@ -1298,3 +1300,5 @@ ValueHandle::~ValueHandle() {
     //                << Operands[0]->use_size() << " " << Operands[0]);
   }
 }
+
+} // End llvm namespace
index a71bd342888cc28d67bb399cd2ab85db2b40985e..4ed281a40afce43e16746365660935f7a4d17a89 100644 (file)
@@ -15,6 +15,8 @@
 #include "llvm/Pass.h"
 #include "llvm/Function.h"
 
+namespace llvm {
+
 namespace {
   // Hello - The first implementation, without getAnalysisUsage.
   struct Hello : public FunctionPass {
@@ -39,3 +41,5 @@ namespace {
   }; 
   RegisterOpt<Hello2> Y("hello2", "Hello World Pass (with getAnalysisUsage implemented)");
 }
+
+} // End llvm namespace
index a4526820e61af4a8c075395521a1a7ad93d6c457..498cd7bb1424bec911b87209d2e627f421128930 100644 (file)
@@ -22,6 +22,8 @@
 #include "llvm/Pass.h"
 #include "Support/Statistic.h"
 
+namespace llvm {
+
 namespace {
   Statistic<> NumMerged("constmerge", "Number of global constants merged");
 
@@ -37,7 +39,6 @@ namespace {
 
 Pass *createConstantMergePass() { return new ConstantMerge(); }
 
-
 bool ConstantMerge::run(Module &M) {
   std::map<Constant*, GlobalVariable*> CMap;
   bool MadeChanges = false;
@@ -78,3 +79,5 @@ bool ConstantMerge::run(Module &M) {
 
   return MadeChanges;
 }
+
+} // End llvm namespace
index 9003f8877f7dd9f65271f59e84046958fe38e9c5..197710d65027c18007ff99fd204fde4fbc305f16 100644 (file)
@@ -30,6 +30,8 @@
 #include "Support/iterator"
 #include <set>
 
+namespace llvm {
+
 namespace {
   Statistic<> NumArgumentsEliminated("deadargelim",
                                      "Number of unread args removed");
@@ -576,3 +578,6 @@ bool DAE::run(Module &M) {
     RemoveDeadArgumentsFromFunction(*DeadRetVal.begin());
   return true;
 }
+
+} // End llvm namespace
+
index c3eb41600294fe02624e95ea729b67f5bd4b8555..126991d3e694e111b87aee9c418dc43be0d75dd8 100644 (file)
@@ -19,6 +19,8 @@
 #include "llvm/DerivedTypes.h"
 #include "Support/Statistic.h"
 
+namespace llvm {
+
 namespace {
   struct DTE : public Pass {
     // doPassInitialization - For this pass, it removes global symbol table
@@ -45,7 +47,6 @@ Pass *createDeadTypeEliminationPass() {
 }
 
 
-
 // ShouldNukeSymtabEntry - Return true if this module level symbol table entry
 // should be eliminated.
 //
@@ -95,3 +96,5 @@ bool DTE::run(Module &M) {
 
   return Changed;
 }
+
+} // End llvm namespace
index 1656c512dde2a8025cbde25ec34a693ab7d5b18a..c1ae2d45e45f50bfa075ee208a86d97be23a4a8d 100644 (file)
@@ -10,6 +10,8 @@
 #include "llvm/Pass.h"
 #include "llvm/Module.h"
 
+namespace llvm {
+
 namespace {
   class FunctionExtractorPass : public Pass {
     Function *Named;
@@ -90,3 +92,5 @@ namespace {
 Pass *createFunctionExtractionPass(Function *F) {
   return new FunctionExtractorPass(F);
 }
+
+} // End llvm namespace
index a21853d207eec02f490e2fd6d37a267a0e79d5bb..2a366c84cd62e5bb12d9b0d35c25f993af95678d 100644 (file)
@@ -29,6 +29,8 @@
 #include "Support/Statistic.h"
 #include <algorithm>
 
+namespace llvm {
+
 namespace {
   Statistic<>NumResolved("funcresolve", "Number of varargs functions resolved");
   Statistic<> NumGlobals("funcresolve", "Number of global variables resolved");
@@ -329,3 +331,5 @@ bool FunctionResolvingPass::run(Module &M) {
 
   return Changed;
 }
+
+} // End llvm namespace
index dc400269e60ead29ee66eead3074b0fc17b6350c..8e7920dc1b681231d3b0c3f8559358faee108b60 100644 (file)
@@ -22,6 +22,8 @@
 #include "Support/Statistic.h"
 #include <set>
 
+namespace llvm {
+
 namespace {
   Statistic<> NumFunctions("globaldce","Number of functions removed");
   Statistic<> NumVariables("globaldce","Number of global variables removed");
@@ -195,3 +197,5 @@ bool GlobalDCE::SafeToDestroyConstant(Constant *C) {
 
   return true;
 }
+
+} // End llvm namespace
index b592138b088155550cf13ab5d0ecac2e4339e96b..b0135d153114dcf16c39b2b6f53b06e8882cc930 100644 (file)
@@ -22,6 +22,8 @@
 #include "llvm/Support/CallSite.h"
 #include "Support/Statistic.h"
 
+namespace llvm {
+
 namespace {
   Statistic<> NumArgumentsProped("ipconstprop",
                                  "Number of args turned into constants");
@@ -121,3 +123,5 @@ bool IPCP::processFunction(Function &F) {
     }
   return MadeChange;
 }
+
+} // End llvm namespace
index 169e57745ac3304fbdb239a69719b8359abdcbd3..715f4462b299b3cdbbfb8c98dc3ef996b8350c40 100644 (file)
@@ -17,6 +17,8 @@
 #include "llvm/Support/CallSite.h"
 #include "llvm/Transforms/IPO.h"
 
+namespace llvm {
+
 namespace {
   // FunctionInfo - For each function, calculate the size of it in blocks and
   // instructions.
@@ -114,3 +116,5 @@ int SimpleInliner::getInlineCost(CallSite CS) {
   InlineCost += CalleeFI.NumInsts*10 + CalleeFI.NumBlocks*20;
   return InlineCost;
 }
+
+} // End llvm namespace
index 8ad72ab9a1702e71c5537588968c883ca48cec9e..bd1bd8370f7aba26cbbcffaa26cdb88bfa7c10db 100644 (file)
@@ -24,6 +24,8 @@
 #include "Support/Debug.h"
 #include "Support/Statistic.h"
 
+namespace llvm {
+
 namespace {
   Statistic<> NumInlined("inline", "Number of functions inlined");
   Statistic<> NumDeleted("inline", "Number of functions deleted because all callers found");
@@ -134,3 +136,5 @@ bool Inliner::performInlining(CallSite CS, std::set<Function*> &SCC) {
   }
   return true; 
 }
+
+} // End llvm namespace
index 1f3d0d2dc22d24b9be7fcf49e24b669fcaa92ad1..805876c54d6f7dd45bf640560fa20384c74369f1 100644 (file)
@@ -20,6 +20,9 @@
 #define DEBUG_TYPE "inline"
 #include "llvm/CallGraphSCCPass.h"
 #include <set>
+
+namespace llvm {
+
 class CallSite;
 
 /// Inliner - This class contains all of the helper code which is used to
@@ -61,5 +64,6 @@ private:
   bool performInlining(CallSite CS, std::set<Function*> &SCC);
 };
 
+} // End llvm namespace
 
 #endif
index 92d389a33d0d8ff60d671bdfbdef084aabc92c1b..574c8bf268f68fa83e528c00a0622e85f52ea1da 100644 (file)
@@ -22,6 +22,8 @@
 #include <fstream>
 #include <set>
 
+namespace llvm {
+
 namespace {
   Statistic<> NumFunctions("internalize", "Number of functions internalized");
   Statistic<> NumGlobals  ("internalize", "Number of global vars internalized");
@@ -119,3 +121,5 @@ namespace {
 Pass *createInternalizePass() {
   return new InternalizePass();
 }
+
+} // End llvm namespace
index abbc2c92c47206f03bb6f249c0626dfb04edb595..276523b00b7dfe564cdcfee01a0582381a06fe35 100644 (file)
@@ -47,6 +47,8 @@
 #include "Support/StringExtras.h"
 #include "Support/VectorExtras.h"
 
+namespace llvm {
+
 namespace {
   Statistic<> LongJmpsTransformed("lowersetjmp",
                                   "Number of longjmps transformed");
@@ -538,3 +540,5 @@ Pass* createLowerSetJmpPass()
 {
   return new LowerSetJmp();
 }
+
+} // End llvm namespace
index dfaf8a89c6d891b1328959b462a1a4534fa9c12f..41835adb4871adcd79d685643e1b6b0622fa2074 100644 (file)
@@ -28,6 +28,8 @@
 #include "Support/Debug.h"
 #include <algorithm>
 
+using namespace llvm;
+
 // ValuePlaceHolder - A stupid little marker value.  It appears as an
 // instruction of type Instruction::UserOp1.
 //
index 77e6ed304080bb96b5089df7758260ea92ccd1ee..fd39b6b12a5e0786f135435df65c25883ca515d7 100644 (file)
@@ -53,6 +53,8 @@
 #include <functional>
 #include <algorithm>
 
+namespace llvm {
+
 //---------------------------------------------------------------------------- 
 // Global constants used in marking Cilk functions and function calls.
 //---------------------------------------------------------------------------- 
@@ -535,3 +537,5 @@ bool Parallelize::run(Module& M)
 
   return true;
 }
+
+} // End llvm namespace
index b377a8befe800dbfa064fe16a7d069a33a2dc50d..30e2514872eaf480ecb56868fba9368cfe6361e0 100644 (file)
@@ -23,6 +23,8 @@
 #include "Support/Statistic.h"
 #include <set>
 
+namespace llvm {
+
 namespace {
   Statistic<> NumRemoved("prune-eh", "Number of invokes removed");
 
@@ -104,3 +106,5 @@ bool PruneEH::runOnSCC(const std::vector<CallGraphNode *> &SCC) {
 
   return MadeChange; 
 }
+
+} // End llvm namespace
index 81abda0006758c4cb652f675035b9f7bede874f6..fd5b7fb1f13c3f25f6a8dcd743f0030bfab31f74 100644 (file)
@@ -22,6 +22,8 @@
 #include "llvm/Support/CallSite.h"
 #include "Support/Statistic.h"
 
+namespace llvm {
+
 namespace {
   Statistic<> NumRaised("raiseallocs", "Number of allocations raised");
 
@@ -194,3 +196,5 @@ bool RaiseAllocations::run(Module &M) {
 
   return Changed;
 }
+
+} // End llvm namespace
index 012fa22770224c17b8e543eef96b4c5d43969bef..0c7091696e4adfd2717bdf3c9d852224ed1cf499 100644 (file)
@@ -23,6 +23,8 @@ using std::vector;
 using std::set;
 using std::pair;
 
+namespace llvm {
+
 namespace {
   struct SimpleStructMutation : public MutateStructTypes {
     enum Transform { SwapElements, SortElements };
@@ -188,3 +190,5 @@ SimpleStructMutation::TransformsType
   
   return Transforms;
 }
+
+} // End llvm namespace
index c371a9fa694be1c9883828d7e7b6bff077591b4e..90ef14df7ecb9cd1ee509d8df2c394cbacc25db0 100644 (file)
@@ -25,6 +25,8 @@
 #include "llvm/Module.h"
 #include "llvm/Pass.h"
 
+namespace llvm {
+
 static void insertInitializationCall(Function *MainFn, const char *FnName,
                                      GlobalValue *Array) {
   const Type *ArgVTy = PointerType::get(PointerType::get(Type::SByteTy));
@@ -181,3 +183,5 @@ bool BlockProfiler::run(Module &M) {
   insertInitializationCall(Main, "llvm_start_block_profiling", Counters);
   return true;
 }
+
+} // End llvm namespace
index 9c395a9c1f65401845834332948d7c1c30c19569..57254b90800eed0fcd7060eb04628dc7b83f6495 100644 (file)
@@ -17,6 +17,8 @@
 #include "llvm/Pass.h"
 #include "llvm/Support/CFG.h"
 
+namespace llvm {
+
 enum Color{
   WHITE,
   GREY,
@@ -104,3 +106,5 @@ bool EmitFunctionTable::run(Module &M){
   M.getGlobalList().push_back(fnCount);
   return true;  // Always modifies program
 }
+
+} // End llvm namespace
index 6c7bb5f36010f7056393880d6083803d63380fb6..04207820a5372cdba6b25bebb81d7a1e28f928fb 100644 (file)
@@ -27,6 +27,8 @@
 #include "llvm/Function.h"
 #include "llvm/Pass.h"
 
+namespace llvm {
+
 //this is used to color vertices
 //during DFS
 
@@ -36,7 +38,7 @@ enum Color{
   BLACK
 };
 
-namespace{
+namespace {
   struct CombineBranches : public FunctionPass {
   private:
     //DominatorSet *DS;
@@ -225,3 +227,5 @@ bool CombineBranches::runOnFunction(Function &F){
   
   return true;
 }
+
+} // End llvm namespace
index 6a7f50e333a75c23d78ea387395740170c1b6a08..3cb5698a11b603c0a7b5697baa021a47ec1e3fa8 100644 (file)
 #define INSERT_LOAD_COUNT
 #define INSERT_STORE
 
+
 using std::vector;
 
+namespace llvm {
 
 static void getTriggerCode(Module *M, BasicBlock *BB, int MethNo, Value *pathNo,
                            Value *cnt, Instruction *rInst){ 
@@ -369,3 +371,4 @@ void insertBB(Edge ed,
   }
 }
 
+} // End llvm namespace
index cae699a8d6e8c17396bc03c7e36f382568b99992..d69c4c3b4ce32570f713d35c27579466ae860150 100644 (file)
@@ -19,6 +19,8 @@
 
 using std::vector;
 
+namespace llvm {
+
 const graphListElement *findNodeInList(const Graph::nodeList &NL,
                                              Node *N) {
   for(Graph::nodeList::const_iterator NI = NL.begin(), NE=NL.end(); NI != NE; 
@@ -564,4 +566,4 @@ void Graph::getBackEdgesVisit(Node *u, vector<Edge > &be,
   color[u]=BLACK;//done with visiting the node and its neighbors
 }
 
-
+} // End llvm namespace
index 5597b599e0601107479e341b810c88bfdc4e880a..44b63a91ea91c596d57ea22cd898b39f384fa81a 100644 (file)
@@ -19,6 +19,8 @@
 #include <map>
 #include <cstdlib>
 
+namespace llvm {
+
 class Module;
 class Function;
 
@@ -112,8 +114,13 @@ struct graphListElement{
   }
 };
 
+} // End llvm namespace
+
 
 namespace std {
+
+using namespace llvm;
+
   template<>
   struct less<Node *> : public binary_function<Node *, Node *,bool> {
     bool operator()(Node *n1, Node *n2) const {
@@ -135,6 +142,8 @@ namespace std {
   };
 }
 
+namespace llvm {
+
 struct BBSort{
   bool operator()(BasicBlock *BB1, BasicBlock *BB2) const{
     std::string name1=BB1->getName();
@@ -465,6 +474,7 @@ int valueAssignmentToEdges(Graph& g, std::map<Node *, int> nodePriority,
                            std::vector<Edge> &be);
 
 void getBBtrace(std::vector<BasicBlock *> &vBB, int pathNo, Function *M);
-#endif
 
+} // End llvm namespace
 
+#endif
index 66b8ccd6c445432646ebd8204477dc5680a41d34..d9dc011cd5e73e7ee270774be3fa7496a03f5f18 100644 (file)
@@ -24,6 +24,8 @@ using std::map;
 using std::vector;
 using std::cerr;
 
+namespace llvm {
+
 //check if 2 edges are equal (same endpoints and same weight)
 static bool edgesEqual(Edge  ed1, Edge ed2){
   return ((ed1==ed2) && ed1.getWeight()==ed2.getWeight());
@@ -673,3 +675,5 @@ void printGraph(Graph &g){
   }
   cerr<<"--------------------Graph\n";
 }
+
+} // End llvm namespace
index b5e9d8c30ccae171b725e3ccd57d4810efe5b5ea..9d6107cd2d2122c626f28ac535370175749c32c4 100644 (file)
@@ -27,6 +27,8 @@
 #include "llvm/Function.h"
 #include "llvm/Pass.h"
 
+namespace llvm {
+
 //this is used to color vertices
 //during DFS
 
@@ -181,3 +183,5 @@ bool InstLoops::runOnFunction(Function &F){
   findAndInstrumentBackEdges(F);
   return true;  // Function was modified.
 }
+
+} // End llvm namespace
index d4973be25eb5c533eadd8cdba2d32b5d4ebd30d1..5728265f42732a64f73dc4d1679beb9710ac0dd4 100644 (file)
@@ -43,6 +43,8 @@
 #include <fstream>
 #include <cstdio>
 
+namespace llvm {
+
 struct ProfilePaths : public FunctionPass {
   bool runOnFunction(Function &F);
 
@@ -245,3 +247,5 @@ bool ProfilePaths::runOnFunction(Function &F){
    
   return true;  // Always modifies function
 }
+
+} // End llvm namespace
index 58b3840587bdf34d6398f4aa42211ef51af72d45..cbb2ae6aee590158e6edc8a761ae43ca663658d4 100644 (file)
@@ -21,6 +21,8 @@ using std::vector;
 using std::map;
 using std::cerr;
 
+namespace llvm {
+
 //Routines to get the path trace!
 
 void getPathFrmNode(Node *n, vector<BasicBlock*> &vBB, int pathNo, Graph &g, 
@@ -303,3 +305,5 @@ void getBBtrace(vector<BasicBlock *> &vBB, int pathNo, Function *M){//,
   }
   */
 }
+
+} // End llvm namespace
index f19ba74000dceeae9f042d7610679723332ed3a2..c802f736046c6e5144d394acecda893e85019c82 100644 (file)
@@ -26,6 +26,8 @@
 #include <algorithm>
 #include <sstream>
 
+namespace llvm {
+
 static cl::opt<bool>
 DisablePtrHashing("tracedisablehashdisable", cl::Hidden,
                   cl::desc("Disable pointer hashing in the -trace or -tracem "
@@ -433,3 +435,5 @@ bool InsertTraceCode::runOnFunction(Function &F) {
   
   return true;
 }
+
+} // End llvm namespace
index cf64aea1cdd70ded5a4c6d0f0ae14b5ec554e72d..c5be82fca7bd1adc130a7a53585fb1a8e69208c4 100644 (file)
@@ -29,6 +29,8 @@
 #include "Support/STLExtras.h"
 #include <algorithm>
 
+namespace llvm {
+
 // StartInst - This enables the -raise-start-inst=foo option to cause the level
 // raising pass to start at instruction "foo", which is immensely useful for
 // debugging!
@@ -55,7 +57,6 @@ NumDCEorCP("raise", "Number of insts DCEd or constprop'd");
 static Statistic<>
 NumVarargCallChanges("raise", "Number of vararg call peepholes");
 
-
 #define PRINT_PEEPHOLE(ID, NUM, I)            \
   DEBUG(std::cerr << "Inst P/H " << ID << "[" << NUM << "] " << I)
 
@@ -86,12 +87,12 @@ namespace {
   RegisterOpt<RPR> X("raise", "Raise Pointer References");
 }
 
+
 Pass *createRaisePointerReferencesPass() {
   return new RPR();
 }
 
 
-
 // isReinterpretingCast - Return true if the cast instruction specified will
 // cause the operand to be "reinterpreted".  A value is reinterpreted if the
 // cast instruction would cause the underlying bits to change.
@@ -617,3 +618,5 @@ bool RPR::runOnFunction(Function &F) {
 
   return Changed;
 }
+
+} // End llvm namespace
index 2735f95d89f1b41414ef6cd3ec15e19b9c5cf95d..e45b2731908935ae694570a5938e057c316763fb 100644 (file)
@@ -28,6 +28,8 @@
 #include "Support/STLExtras.h"
 #include <algorithm>
 
+namespace llvm {
+
 namespace {
   Statistic<> NumBlockRemoved("adce", "Number of basic blocks removed");
   Statistic<> NumInstRemoved ("adce", "Number of instructions removed");
@@ -456,3 +458,5 @@ bool ADCE::doADCE() {
 
   return MadeChanges;
 }
+
+} // End llvm namespace
index ceef34e54ec5db61d2fd89e5281b517f54c16220..66e78960f78d2f9e7bb9a38ccf72e13bdd3bb60b 100644 (file)
@@ -27,6 +27,8 @@
 #include "Support/Statistic.h"
 #include <set>
 
+namespace llvm {
+
 namespace {
   Statistic<> NumInstKilled("constprop", "Number of instructions killed");
 
@@ -73,3 +75,5 @@ bool ConstantPropagation::runOnFunction(Function &F) {
   }
   return Changed;
 }
+
+} // End llvm namespace
index aad9b7f30961a0018344aadf4c3f9df32fb7d864..a0358b54ad2dd5ad1350f91e215b1d6a12d6328d 100644 (file)
@@ -42,6 +42,8 @@
 #include "Support/Statistic.h"
 #include <algorithm>
 
+namespace llvm {
+
 namespace {
   Statistic<> NumSetCCRemoved("cee", "Number of setcc instruction eliminated");
   Statistic<> NumOperandsCann("cee", "Number of operands canonicalized");
@@ -1314,3 +1316,5 @@ void Relation::print(std::ostream &OS) const {
 void Relation::dump() const { print(std::cerr); }
 void ValueInfo::dump() const { print(std::cerr, 0); }
 void RegionInfo::dump() const { print(std::cerr); }
+
+} // End llvm namespace
index e3fc8de396c9f05616f62a7905519f50a2790b18..3e63cadd3e51b4aa897361ab19538f571f9c7406 100644 (file)
@@ -24,6 +24,8 @@
 #include "Support/Statistic.h"
 #include <set>
 
+namespace llvm {
+
 namespace {
   Statistic<> DIEEliminated("die", "Number of insts removed");
   Statistic<> DCEEliminated("dce", "Number of insts removed");
@@ -57,7 +59,6 @@ Pass *createDeadInstEliminationPass() {
 }
 
 
-
 //===----------------------------------------------------------------------===//
 // DeadCodeElimination pass implementation
 //
@@ -124,3 +125,5 @@ bool DCE::runOnFunction(Function &F) {
 Pass *createDeadCodeEliminationPass() {
   return new DCE();
 }
+
+} // End llvm namespace
index d6aee14f2406bd918a4e9b056084714d742accc5..e110cdac8b7ff7b7c0212576a2fc21ddbddfd81c 100644 (file)
@@ -25,6 +25,8 @@
 #include "llvm/Pass.h"
 #include "Support/Statistic.h"
 
+namespace llvm {
+
 namespace {
   Statistic<> NumAdded("lowerrefs", "# of getelementptr instructions added");
 
@@ -36,13 +38,6 @@ namespace {
 RegisterOpt<DecomposePass> X("lowerrefs", "Decompose multi-dimensional "
                              "structure/array references");
 
-FunctionPass
-*createDecomposeMultiDimRefsPass()
-{
-  return new DecomposePass();
-}
-
-
 // runOnBasicBlock - Entry point for array or structure references with multiple
 // indices.
 //
@@ -57,6 +52,11 @@ DecomposePass::runOnBasicBlock(BasicBlock &BB)
   return changed;
 }
 
+FunctionPass
+*createDecomposeMultiDimRefsPass()
+{
+  return new DecomposePass();
+}
 
 // Function: DecomposeArrayRef()
 //  
@@ -134,3 +134,5 @@ DecomposeArrayRef(GetElementPtrInst* GEP)
 
   return true;
 }
+
+} // End llvm namespace
index e1654e5d7f309d22f8c5af041aa762ff42620d91..b00d3005bfa6c6159b45f9e42f5ceb81f0c9b65e 100644 (file)
@@ -23,6 +23,8 @@
 #include "Support/Statistic.h"
 #include <algorithm>
 
+namespace llvm {
+
 namespace {
   Statistic<> NumInstRemoved("gcse", "Number of instructions removed");
   Statistic<> NumLoadRemoved("gcse", "Number of loads removed");
@@ -56,7 +58,6 @@ namespace {
 // createGCSEPass - The public interface to this file...
 FunctionPass *createGCSEPass() { return new GCSE(); }
 
-
 // GCSE::runOnFunction - This is the main transformation entry point for a
 // function.
 //
@@ -269,3 +270,5 @@ Instruction *GCSE::EliminateCSE(Instruction *I, Instruction *Other) {
 
   return Ret;
 }
+
+} // End llvm namespace
index 1744fe41b2df4b1dad83da77c42fedeea2328c2a..0777a1e09fd6d0eef1c8091bfd42e66d01080bd0 100644 (file)
@@ -26,6 +26,8 @@
 #include "Support/Statistic.h"
 #include "Support/STLExtras.h"
 
+namespace llvm {
+
 namespace {
   Statistic<> NumRemoved ("indvars", "Number of aux indvars removed");
   Statistic<> NumInserted("indvars", "Number of canonical indvars added");
@@ -217,3 +219,5 @@ namespace {
 Pass *createIndVarSimplifyPass() {
   return new InductionVariableSimplify();
 }
+
+} // End llvm namespace
index 07736b57c2de959fa46c7983078ecdd1cc76f1f5..8522b610e1378093eaa6c52e260dbb917aa5145e 100644 (file)
@@ -49,6 +49,8 @@
 #include "Support/Statistic.h"
 #include <algorithm>
 
+namespace llvm {
+
 namespace {
   Statistic<> NumCombined ("instcombine", "Number of insts combined");
   Statistic<> NumConstProp("instcombine", "Number of constant folds");
@@ -2196,3 +2198,5 @@ bool InstCombiner::runOnFunction(Function &F) {
 Pass *createInstructionCombiningPass() {
   return new InstCombiner();
 }
+
+} // End llvm namespace
index 0f582c1feba5f7a0ed5d94a53c412435503691e3..be635dff35ba4878a48a954c8301911d8ba63942 100644 (file)
@@ -44,6 +44,8 @@
 #include "llvm/Assembly/Writer.h"
 #include <algorithm>
 
+namespace llvm {
+
 namespace {
   cl::opt<bool>
   DisablePromotion("disable-licm-promotion", cl::Hidden,
@@ -466,3 +468,5 @@ void LICM::findPromotableValuesInLoop(
     }
   }
 }
+
+} // End llvm namespace
index fad5789d5ade327d3d251932605e9cfb8aa1f7f4..770cd44d75f7e8a0b1220fb1a32203a055f6556e 100644 (file)
 #include "Support/Statistic.h"
 #include "Support/hash_set"
 
+namespace llvm {
+
 namespace {
   Statistic<> NumExprsEliminated("pre", "Number of expressions constantified");
   Statistic<> NumRedundant      ("pre", "Number of redundant exprs eliminated");
-  Statistic<> NumInserted       ("pre", "Number of expressions inserted");
+  static Statistic<> NumInserted       ("pre", "Number of expressions inserted");
 
   struct PRE : public FunctionPass {
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
@@ -630,3 +632,5 @@ bool PRE::ProcessExpression(Instruction *Expr) {
 
   return Changed;
 }
+
+} // End llvm namespace
index b5011af28650510fc64b4ce417c3a50bfb36fc9b..89ec20e06900b6ee2843f69d8ac960fc83027f2a 100644 (file)
@@ -42,6 +42,8 @@
 #include "llvm/Support/CFG.h"
 #include "Support/Statistic.h"
 
+namespace llvm {
+
 namespace {
   Statistic<> NumInserted("pinodes", "Number of Pi nodes inserted");
 
@@ -182,3 +184,5 @@ bool PiNodeInserter::insertPiNodeFor(Value *V, BasicBlock *Succ, Value *Rep) {
   return true;
 }
 
+
+} // End llvm namespace
index befdcfec774927e96a57142c303ac1b3a82458e8..9e22ec4e7e5cb302ef399816285bdee5c38aceb1 100644 (file)
@@ -34,6 +34,8 @@
 #include "Support/PostOrderIterator.h"
 #include "Support/Statistic.h"
 
+namespace llvm {
+
 namespace {
   Statistic<> NumLinear ("reassociate","Number of insts linearized");
   Statistic<> NumChanged("reassociate","Number of insts reassociated");
@@ -58,6 +60,7 @@ namespace {
   RegisterOpt<Reassociate> X("reassociate", "Reassociate expressions");
 }
 
+// Public interface to the Reassociate pass
 FunctionPass *createReassociatePass() { return new Reassociate(); }
 
 void Reassociate::BuildRankMap(Function &F) {
@@ -291,3 +294,5 @@ bool Reassociate::runOnFunction(Function &F) {
   ValueRankMap.clear();
   return Changed;
 }
+
+} // End llvm namespace
index 01e3e26ab536c9e0bca6ae2ada04ceff775ab79b..44a553a01bcd8fe29607f8dd27f45e388ec8d98a 100644 (file)
@@ -33,6 +33,8 @@
 #include <algorithm>
 #include <set>
 
+namespace llvm {
+
 // InstVal class - This class represents the different lattice values that an 
 // instruction may occupy.  It is a simple class with value semantics.
 //
@@ -253,7 +255,6 @@ private:
 
 
 // createSCCPPass - This is the public interface to this file...
-//
 Pass *createSCCPPass() {
   return new SCCP();
 }
@@ -585,3 +586,5 @@ void SCCP::visitGetElementPtrInst(GetElementPtrInst &I) {
 
   markConstant(&I, ConstantExpr::getGetElementPtr(Ptr, Operands));  
 }
+
+} // End llvm namespace
index 9342a5cf406d14ab1ecae0665377e00f7be91520..d29119061dc2a9405c3a9e493ba1d385e1fc1280 100644 (file)
@@ -32,6 +32,8 @@
 #include "Support/Statistic.h"
 #include "Support/StringExtras.h"
 
+namespace llvm {
+
 namespace {
   Statistic<> NumReplaced("scalarrepl", "Number of allocas broken up");
   Statistic<> NumPromoted("scalarrepl", "Number of allocas promoted");
@@ -61,6 +63,7 @@ namespace {
   RegisterOpt<SROA> X("scalarrepl", "Scalar Replacement of Aggregates");
 }
 
+// Public interface to the ScalarReplAggregates pass
 Pass *createScalarReplAggregatesPass() { return new SROA(); }
 
 
@@ -298,3 +301,5 @@ bool SROA::isSafeAllocaToPromote(AllocationInst *AI) {
     }
   return true;
 }
+
+} // End llvm namespace
index 224d6c5f9ae40969cca4169be63dfcbc226ba8e2..5a8d428153821d25a8e96ad074f0b01b56f9d96a 100644 (file)
@@ -26,6 +26,8 @@
 #include "Support/Statistic.h"
 #include <set>
 
+namespace llvm {
+
 namespace {
   Statistic<> NumSimpl("cfgsimplify", "Number of blocks simplified");
 
@@ -35,6 +37,7 @@ namespace {
   RegisterOpt<CFGSimplifyPass> X("simplifycfg", "Simplify the CFG");
 }
 
+// Public interface to the CFGSimplification pass
 FunctionPass *createCFGSimplificationPass() {
   return new CFGSimplifyPass();
 }
@@ -100,3 +103,5 @@ bool CFGSimplifyPass::runOnFunction(Function &F) {
 
   return Changed;
 }
+
+} // End llvm namespace
index 58395c55ab83b777d962809c2f9856fc821ed864..9e058e7939d115cf8f2ab13a2476f6c1845a90c3 100644 (file)
@@ -26,6 +26,8 @@
 #include "llvm/SymbolTable.h"
 #include "llvm/Pass.h"
 
+namespace llvm {
+
 static bool StripSymbolTable(SymbolTable &SymTab) {
   bool RemovedSymbol = false;
 
@@ -74,3 +76,5 @@ Pass *createSymbolStrippingPass() {
 Pass *createFullSymbolStrippingPass() {
   return new FullSymbolStripping();
 }
+
+} // End llvm namespace
index d0a7765818747698fc1f5a9da91c66f1b1c81eeb..07a3b1e492af734a88db79ca4269b555b685e8d8 100644 (file)
@@ -31,6 +31,8 @@
 #include "Support/Debug.h"
 #include "Support/Statistic.h"
 
+namespace llvm {
+
 namespace {
   Statistic<> NumEliminated("tailduplicate",
                             "Number of unconditional branches eliminated");
@@ -53,6 +55,7 @@ namespace {
   RegisterOpt<TailDup> X("tailduplicate", "Tail Duplication");
 }
 
+// Public interface to the Tail Duplication pass
 Pass *createTailDuplicationPass() { return new TailDup(); }
 
 /// runOnFunction - Top level algorithm - Loop over each unconditional branch in
@@ -339,3 +342,5 @@ Value *TailDup::GetValueOutBlock(BasicBlock *BB, Value *OrigVal,
 
   return GetValueInBlock(BB, OrigVal, ValueMap, OutValueMap);
 }
+
+} // End llvm namespace
index d07f4e857eee7a16bf5b08353842ef9f6262fcef..dbe91a79407c668d7a787e5268efbc2462b09e42 100644 (file)
@@ -33,6 +33,8 @@
 #include "llvm/Pass.h"
 #include "Support/Statistic.h"
 
+namespace llvm {
+
 namespace {
   Statistic<> NumEliminated("tailcallelim", "Number of tail calls removed");
 
@@ -42,6 +44,7 @@ namespace {
   RegisterOpt<TailCallElim> X("tailcallelim", "Tail Call Elimination");
 }
 
+// Public interface to the TailCallElimination pass
 FunctionPass *createTailCallEliminationPass() { return new TailCallElim(); }
 
 
@@ -105,3 +108,4 @@ bool TailCallElim::runOnFunction(Function &F) {
   return MadeChange;
 }
 
+} // End llvm namespace
index 3a1d51c3a02c9518386bfec31fdb74ce1eaac494..b553f03a41b5f07da624ce641a7371f07259ea2f 100644 (file)
@@ -18,6 +18,8 @@
 #include "llvm/Function.h"
 #include "llvm/iOther.h"
 
+namespace llvm {
+
 static const Type *getStructOffsetStep(const StructType *STy, uint64_t &Offset,
                                        std::vector<Value*> &Indices,
                                        const TargetData &TD) {
@@ -193,3 +195,5 @@ const Type *ConvertibleToGEP(const Type *Ty, Value *OffsetVal,
 
   return NextTy;
 }
+
+} // End llvm namespace
index 4f92dc4eda8db3a7c6e1bdb3d80fbaf237a810f5..3b80146a2780c14b28215ca642bd3d8a04952ab6 100644 (file)
@@ -22,6 +22,8 @@
 #include <map>
 #include <set>
 
+namespace llvm {
+
 static inline int64_t getConstantValue(const ConstantInt *CPI) {
   return (int64_t)cast<ConstantInt>(CPI)->getRawValue();
 }
@@ -139,4 +141,6 @@ const Type *getStructOffsetType(const Type *Ty, unsigned &Offset,
                                 std::vector<Value*> &Offsets,
                                 const TargetData &TD, bool StopEarly = true);
 
+} // End llvm namespace
+
 #endif
index 22fd555a46a3149985cf05db385a6413a356778a..5fb5469332538e1f2a89e2f6d469af43c6f56691 100644 (file)
@@ -19,6 +19,8 @@
 #include "llvm/Type.h"
 #include <algorithm>
 
+namespace llvm {
+
 // ReplaceInstWithValue - Replace all uses of an instruction (specified by BI)
 // with a value, then remove and delete the original instruction.
 //
@@ -112,3 +114,5 @@ void RemoveSuccessor(TerminatorInst *TI, unsigned SuccNum) {
   if (NewTI)   // If it's a different instruction, replace.
     ReplaceInstWithInst(TI, NewTI);
 }
+
+} // End llvm namespace
index de59db2f9bc8ee2511dfcf054c7ab80f69604dbd..e8201cc3915471b0bd97a73fa46fdb20b3221778 100644 (file)
@@ -25,6 +25,8 @@
 #include "llvm/Support/CFG.h"
 #include "Support/Statistic.h"
 
+namespace llvm {
+
 namespace {
   Statistic<> NumBroken("break-crit-edges", "Number of blocks inserted");
 
@@ -168,3 +170,5 @@ bool SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P) {
   }
   return true;
 }
+
+} // End llvm namespace
index e0312f2efb2917aa792c4c6ef3cb954e3256d51b..d8aa9aebe43bcafd66385f7974c55a8336778bad 100644 (file)
@@ -19,6 +19,8 @@
 #include "llvm/Function.h"
 #include "ValueMapper.h"
 
+namespace llvm {
+
 // RemapInstruction - Convert the instruction operands from referencing the 
 // current values into those specified by ValueMap.
 //
@@ -140,3 +142,5 @@ Function *CloneFunction(const Function *F,
   CloneFunctionInto(NewF, F, ValueMap, Returns);
   return NewF;                    
 }
+
+} // End llvm namespace
index cc22c7214a5861b6c6df9e43ccb374b66ae72224..21a8675f07b9595229e4e1e87021890ad836b241 100644 (file)
@@ -19,6 +19,8 @@
 #include "llvm/Constant.h"
 #include "ValueMapper.h"
 
+namespace llvm {
+
 /// CloneModule - Return an exact copy of the specified module.  This is not as
 /// easy as it might seem because we have to worry about making copies of global
 /// variables and functions, and making their (initializers and references,
@@ -88,3 +90,5 @@ Module *CloneModule(const Module *M) {
 
   return New;
 }
+
+} // End llvm namespace
index 9d995464bf8dc48ccd08304971b60ebbfcf10e2e..990e54c783b0230e4b84dd442aec436da30a3503 100644 (file)
@@ -20,6 +20,8 @@
 #include "llvm/Function.h"
 
 
+namespace llvm {
+
 //Clones the trace (a vector of basic blocks)
 std::vector<BasicBlock *> CloneTrace(const std::vector<BasicBlock*> &origTrace) {
 
@@ -86,3 +88,5 @@ std::vector<BasicBlock *> CloneTrace(const std::vector<BasicBlock*> &origTrace)
   //return new vector of basic blocks
   return clonedTrace;
 }
+
+} // End llvm namespace
index bd605ca789034dfa68b8a6c4e172beeef26bc095..e35dca4de03100e03f4a87e8bf121ca34312a8dc 100644 (file)
@@ -22,6 +22,8 @@
 #include "llvm/Type.h"
 #include "Support/hash_set"
 
+namespace llvm {
+
 typedef hash_set<PHINode*>           PhiSet;
 typedef hash_set<PHINode*>::iterator PhiSetIterator;
 
@@ -160,3 +162,5 @@ AllocaInst* DemoteRegToStack(Instruction& X) {
 
   return XSlot;
 }
+
+} // End llvm namespace
index 1481324330a93eb2298d73d97576c6b234cfd0e1..265d5c419acf6f91c63555f58eb06162099614ca 100644 (file)
@@ -24,6 +24,8 @@
 #include "llvm/Support/CallSite.h"
 #include "llvm/Transforms/Utils/Local.h"
 
+namespace llvm {
+
 bool InlineFunction(CallInst *CI) { return InlineFunction(CallSite(CI)); }
 bool InlineFunction(InvokeInst *II) { return InlineFunction(CallSite(II)); }
 
@@ -278,3 +280,5 @@ bool InlineFunction(CallSite CS) {
   SimplifyCFG(AfterCallBB);
   return true;
 }
+
+} // End llvm namespace
index 0be840fb6cd8189df793db59ab5325435e788857..4bc78a4cde3c5b3d39066e3c58fab6f5717ac139 100644 (file)
@@ -23,6 +23,8 @@
 #include "llvm/iOther.h"
 #include "llvm/Constants.h"
 
+namespace llvm {
+
 // Error - Simple wrapper function to conditionally assign to E and return true.
 // This just makes error return conditions a little bit simpler...
 //
@@ -902,3 +904,4 @@ bool LinkModules(Module *Dest, const Module *Src, std::string *ErrorMsg) {
   return false;
 }
 
+} // End llvm namespace
index 2f9b07ca9450539bad16ee1bd89a71c0996a3f1a..894699596e1aadb61d90078f5c9e8d65281cb922 100644 (file)
@@ -17,6 +17,8 @@
 #include "llvm/iOperators.h"
 #include "llvm/ConstantHandling.h"
 
+namespace llvm {
+
 //===----------------------------------------------------------------------===//
 //  Local constant propagation...
 //
@@ -180,3 +182,5 @@ bool dceInstruction(BasicBlock::iterator &BBI) {
   }
   return false;
 }
+
+} // End llvm namespace
index a1f86486b538b606ec22bac8693d66d1bbe718e9..b999ed40cc9321f7afffc48105f705a51fafda0a 100644 (file)
@@ -43,6 +43,8 @@
 #include "Support/Statistic.h"
 #include "Support/DepthFirstIterator.h"
 
+namespace llvm {
+
 namespace {
   Statistic<>
   NumInserted("loopsimplify", "Number of pre-header blocks inserted");
@@ -82,7 +84,6 @@ namespace {
 const PassInfo *LoopSimplifyID = X.getPassInfo();
 Pass *createLoopSimplifyPass() { return new LoopSimplify(); }
 
-
 /// runOnFunction - Run down all loops in the CFG (recursively, but we could do
 /// it in any convenient order) inserting preheaders...
 ///
@@ -566,3 +567,5 @@ void LoopSimplify::UpdateDomInfoForRevectoredPreds(BasicBlock *NewBB,
     }
   }
 }
+
+} // End llvm namespace
index 96008881bbaba321325a9e0efee3ad73f709de54..eea800ad54759f94390b9e0d6faf4129418332c8 100644 (file)
@@ -22,6 +22,8 @@
 #include "llvm/Target/TargetData.h"
 #include "Support/Statistic.h"
 
+namespace llvm {
+
 namespace {
   Statistic<> NumLowered("lowerallocs", "Number of allocations lowered");
 
@@ -131,3 +133,5 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) {
 
   return Changed;
 }
+
+} // End llvm namespace
index 4885d96f19f4071b8651ff4534228faa2347b47e..ec97ca20409e1efb2d94115c5903bc864920c119 100644 (file)
@@ -23,6 +23,8 @@
 #include "llvm/Constant.h"
 #include "Support/Statistic.h"
 
+namespace llvm {
+
 namespace {
   Statistic<> NumLowered("lowerinvoke", "Number of invoke & unwinds replaced");
 
@@ -37,6 +39,7 @@ namespace {
   X("lowerinvoke", "Lower invoke and unwind, for unwindless code generators");
 }
 
+// Public Interface To the LowerInvoke pass.
 FunctionPass *createLowerInvokePass() { return new LowerInvoke(); }
 
 // doInitialization - Make sure that there is a prototype for abort in the
@@ -79,3 +82,5 @@ bool LowerInvoke::runOnFunction(Function &F) {
     }
   return Changed;
 }
+
+} // End llvm namespace
index a45192bb0cf52d67aaaca340a0d46646749df7ad..1d0e47145ac26e6734879d2406a114763d1b1933 100644 (file)
@@ -23,6 +23,8 @@
 #include "Support/Debug.h"
 #include "Support/Statistic.h"
 
+namespace llvm {
+
 namespace {
   Statistic<> NumLowered("lowerswitch", "Number of SwitchInst's replaced");
 
@@ -224,3 +226,5 @@ void LowerSwitch::processSwitchInst(SwitchInst *SI) {
   // We are now done with the switch instruction, delete it.
   delete SI;
 }
+
+} // End llvm namespace
index d915155ed4bfb4a8f2fe3404bc7f8ab3ceadf8b7..4d99280805822c24d361513f160c056b31e4e414 100644 (file)
@@ -20,6 +20,8 @@
 #include "llvm/Target/TargetData.h"
 #include "Support/Statistic.h"
 
+namespace llvm {
+
 namespace {
   Statistic<> NumPromoted("mem2reg", "Number of alloca's promoted");
 
@@ -78,3 +80,5 @@ bool PromotePass::runOnFunction(Function &F) {
 Pass *createPromoteMemoryToRegister() {
   return new PromotePass();
 }
+
+} // End llvm namespace
index f920718c3a9c8c3931d649354c7ce73457f2744c..0859f6998011197d793f2bf65865baa8ae8b111c 100644 (file)
@@ -25,6 +25,8 @@
 #include "llvm/Support/CFG.h"
 #include "Support/StringExtras.h"
 
+namespace llvm {
+
 /// isAllocaPromotable - Return true if this alloca is legal for promotion.
 /// This is true if there are only loads and stores to the alloca...
 ///
@@ -459,3 +461,5 @@ void PromoteMemToReg(const std::vector<AllocaInst*> &Allocas,
   if (Allocas.empty()) return;
   PromoteMem2Reg(Allocas, DT, DF, TD).run();
 }
+
+} // End llvm namespace
index a5f54b1326c1c4d6ca7ce0469fe7eabab842db79..158d9119ae5aa83aea42a0ba28c0cea039d59fbd 100644 (file)
@@ -21,6 +21,8 @@
 #include <algorithm>
 #include <functional>
 
+namespace llvm {
+
 // PropagatePredecessors - This gets "Succ" ready to have the predecessors from
 // "BB".  This is a little tricky because "Succ" has PHI nodes, which need to
 // have extra slots added to them to hold the merge edges from BB's
@@ -298,3 +300,5 @@ bool SimplifyCFG(BasicBlock *BB) {
   
   return Changed;
 }
+
+} // End llvm namespace
index 180871b09372a05945ad65b4d7dbaebe51267bc2..2591ffd6d72c0924777f212840e0068a9c09c5f4 100644 (file)
@@ -22,6 +22,8 @@
 #include "llvm/iPHINode.h"
 #include "llvm/Type.h"
 
+namespace llvm {
+
 static RegisterOpt<UnifyFunctionExitNodes>
 X("mergereturn", "Unify function exit nodes");
 
@@ -112,3 +114,5 @@ bool UnifyFunctionExitNodes::runOnFunction(Function &F) {
   ReturnBlock = NewRetBlock;
   return true;
 }
+
+} // End llvm namespace
index 6590498bbc146d54ef682845bd5da30c4e1ab367..248ebace7a5cf7656cd693160ca85dac5506bdf9 100644 (file)
@@ -16,6 +16,8 @@
 #include "llvm/Constants.h"
 #include "llvm/Instruction.h"
 
+namespace llvm {
+
 Value *MapValue(const Value *V, std::map<const Value*, Value*> &VM) {
   Value *&VMSlot = VM[V];
   if (VMSlot) return VMSlot;      // Does it exist in the map yet?
@@ -105,3 +107,4 @@ Value *MapValue(const Value *V, std::map<const Value*, Value*> &VM) {
   return 0;
 }
 
+} // End llvm namespace
index 8264ade108ad9ee8f9b83b6f110e8c0d65315c3b..e67b3261dba85da0f08c1f3aaee978a2c9c994b2 100644 (file)
 #define LIB_TRANSFORMS_UTILS_VALUE_MAPPER_H
 
 #include <map>
+
+namespace llvm {
+
 class Value;
 
 Value *MapValue(const Value *V, std::map<const Value*, Value*> &VM);
 
+} // End llvm namespace
+
 #endif
index c9c4dde7e85ae5368de66f25628b62a13f146767..67ccdd0f8deacc6c04a73d3b2ea4649027ee9150 100644 (file)
@@ -33,6 +33,8 @@
 #include "Support/STLExtras.h"
 #include <algorithm>
 
+namespace llvm {
+
 static RegisterPass<PrintModulePass>
 X("printm", "Print module to stderr",PassInfo::Analysis|PassInfo::Optimization);
 static RegisterPass<PrintFunctionPass>
@@ -1052,3 +1054,5 @@ CachedWriter &CachedWriter::operator<<(const Value *V) {
   }
   return *this;
 }
+
+} // End llvm namespace
index 2458cda203612e192eea8b440d1159887638ecbb..63a722b33e40389c0cf082e2ea7e9d98eb0ff5dd 100644 (file)
@@ -22,6 +22,8 @@
 #include "SymbolTableListTraitsImpl.h"
 #include <algorithm>
 
+namespace llvm {
+
 // DummyInst - An instance of this class is used to mark the end of the
 // instruction list.  This is not a real instruction.
 //
@@ -141,7 +143,7 @@ void BasicBlock::dropAllReferences() {
 //
 bool BasicBlock::hasConstantReferences() const {
   for (use_const_iterator I = use_begin(), E = use_end(); I != E; ++I)
-    if (::isa<Constant>((Value*)*I))
+    if (isa<Constant>((Value*)*I))
       return true;
 
   return false;
@@ -263,3 +265,5 @@ BasicBlock *BasicBlock::splitBasicBlock(iterator I, const std::string &BBName) {
   }
   return New;
 }
+
+} // End llvm namespace
index 32b9ebba742d550404467f542fe3169df82091e0..7fb7a05e55d3df40ed8fbb8e5c817e5f1264e7e1 100644 (file)
@@ -17,6 +17,8 @@
 #include "llvm/DerivedTypes.h"
 #include <cmath>
 
+namespace llvm {
+
 AnnotationID ConstRules::AID(AnnotationManager::getID("opt::ConstRules",
                                                      &ConstRules::find));
 
@@ -638,3 +640,5 @@ ConstRules *ConstRules::getConstantExprRules() {
   static EmptyRules CERules;
   return &CERules;
 }
+
+} // End llvm namespace
index a27283c44078038d648aaa932093e197ee13d316..a0a01e5306309d71f1cd44c8f1ab8f15f34e5210 100644 (file)
@@ -42,6 +42,9 @@
 
 #include "llvm/Constants.h"
 #include "llvm/Type.h"
+
+namespace llvm {
+
 class PointerType;
 
 //===----------------------------------------------------------------------===//
@@ -244,4 +247,7 @@ Constant *ConstantFoldShiftInstruction(unsigned Opcode, const Constant *V1,
                                        const Constant *V2);
 Constant *ConstantFoldGetElementPtr(const Constant *C,
                                     const std::vector<Constant*> &IdxList);
+
+} // End llvm namespace
+
 #endif
index a27283c44078038d648aaa932093e197ee13d316..a0a01e5306309d71f1cd44c8f1ab8f15f34e5210 100644 (file)
@@ -42,6 +42,9 @@
 
 #include "llvm/Constants.h"
 #include "llvm/Type.h"
+
+namespace llvm {
+
 class PointerType;
 
 //===----------------------------------------------------------------------===//
@@ -244,4 +247,7 @@ Constant *ConstantFoldShiftInstruction(unsigned Opcode, const Constant *V1,
                                        const Constant *V2);
 Constant *ConstantFoldGetElementPtr(const Constant *C,
                                     const std::vector<Constant*> &IdxList);
+
+} // End llvm namespace
+
 #endif
index a9e1204de52db2999ff1cb2422e5d2dde56cebaf..e180f12a1a045f2b7fa14fa731c90bc8d266e081 100644 (file)
@@ -26,6 +26,8 @@
 #include "llvm/Instruction.h"
 #include "llvm/ConstantHandling.h"
 
+namespace llvm {
+
 /// Initialize a full (the default) or empty set for the specified type.
 ///
 ConstantRange::ConstantRange(const Type *Ty, bool Full) {
@@ -248,3 +250,5 @@ void ConstantRange::print(std::ostream &OS) const {
 void ConstantRange::dump() const {
   print(std::cerr);
 }
+
+} // End llvm namespace
index 28cc9d24e036fb1dfa387f96e5779409f676abeb..527eff5490802eb9525a321f1f9aed02451a5940 100644 (file)
@@ -20,6 +20,8 @@
 #include "Support/StringExtras.h"
 #include <algorithm>
 
+namespace llvm {
+
 ConstantBool *ConstantBool::True  = new ConstantBool(true);
 ConstantBool *ConstantBool::False = new ConstantBool(false);
 
@@ -1029,3 +1031,5 @@ unsigned Constant::mutateReferences(Value *OldV, Value *NewV) {
     return NumReplaced;
   }
 }
+
+} // End llvm namespace
index c3bce78b5ad6d0156bfd1b33c2e3f6b89ac1d76c..cad66853c9cd494538c6b6b7c1f60e0c3ee7e4ae 100644 (file)
@@ -20,6 +20,8 @@
 #include "Support/DepthFirstIterator.h"
 #include "Support/SetOperations.h"
 
+namespace llvm {
+
 //===----------------------------------------------------------------------===//
 //  DominatorSet Implementation
 //===----------------------------------------------------------------------===//
@@ -358,3 +360,5 @@ void DominanceFrontierBase::print(std::ostream &o) const {
     o << " is:\t" << I->second << "\n";
   }
 }
+
+} // End llvm namespace
index f47ecea7af3db6a2868c4a714f5c94a991e27bcb..364cc6f733ebc9f50841c17a968993e236491fb1 100644 (file)
@@ -19,6 +19,8 @@
 #include "Support/LeakDetector.h"
 #include "SymbolTableListTraitsImpl.h"
 
+namespace llvm {
+
 BasicBlock *ilist_traits<BasicBlock>::createNode() {
   BasicBlock *Ret = new BasicBlock();
   // This should not be garbage monitored.
@@ -158,7 +160,7 @@ void Function::dropAllReferences() {
 }
 
 /// getIntrinsicID - This method returns the ID number of the specified
-/// function, or LLVMIntrinsic::not_intrinsic if the function is not an
+/// function, or Intrinsic::not_intrinsic if the function is not an
 /// intrinsic, or if the pointer is null.  This value is always defined to be
 /// zero to allow easy checking for whether a function is intrinsic or not.  The
 /// particular intrinsic functions which correspond to this value are defined in
@@ -176,21 +178,21 @@ unsigned Function::getIntrinsicID() const {
    std::string name;  // The name of the intrinsic 
    unsigned id;       // Its ID number
   } alpha_intrinsics[] = {
-     { "llvm.alpha.ctlz",      LLVMIntrinsic::alpha_ctlz },
-     { "llvm.alpha.cttz",      LLVMIntrinsic::alpha_cttz },
-     { "llvm.alpha.ctpop",     LLVMIntrinsic::alpha_ctpop },
-     { "llvm.alpha.umulh",     LLVMIntrinsic::alpha_umulh },
-     { "llvm.alpha.vecop",     LLVMIntrinsic::alpha_vecop },
-     { "llvm.alpha.pup",       LLVMIntrinsic::alpha_pup },
-     { "llvm.alpha.bytezap",   LLVMIntrinsic::alpha_bytezap },
-     { "llvm.alpha.bytemanip", LLVMIntrinsic::alpha_bytemanip },
-     { "llvm.alpha.dfp_bop",   LLVMIntrinsic::alpha_dfpbop }, 
-     { "llvm.alpha.dfp_uop",   LLVMIntrinsic::alpha_dfpuop },
-     { "llvm.alpha.unordered", LLVMIntrinsic::alpha_unordered },
-     { "llvm.alpha.uqtodfp",   LLVMIntrinsic::alpha_uqtodfp },
-     { "llvm.alpha.uqtosfp",   LLVMIntrinsic::alpha_uqtosfp },
-     { "llvm.alpha.dfptosq",   LLVMIntrinsic::alpha_dfptosq },
-     { "llvm.alpha.sfptosq",   LLVMIntrinsic::alpha_sfptosq },
+     { "llvm.alpha.ctlz",      Intrinsic::alpha_ctlz },
+     { "llvm.alpha.cttz",      Intrinsic::alpha_cttz },
+     { "llvm.alpha.ctpop",     Intrinsic::alpha_ctpop },
+     { "llvm.alpha.umulh",     Intrinsic::alpha_umulh },
+     { "llvm.alpha.vecop",     Intrinsic::alpha_vecop },
+     { "llvm.alpha.pup",       Intrinsic::alpha_pup },
+     { "llvm.alpha.bytezap",   Intrinsic::alpha_bytezap },
+     { "llvm.alpha.bytemanip", Intrinsic::alpha_bytemanip },
+     { "llvm.alpha.dfp_bop",   Intrinsic::alpha_dfpbop }, 
+     { "llvm.alpha.dfp_uop",   Intrinsic::alpha_dfpuop },
+     { "llvm.alpha.unordered", Intrinsic::alpha_unordered },
+     { "llvm.alpha.uqtodfp",   Intrinsic::alpha_uqtodfp },
+     { "llvm.alpha.uqtosfp",   Intrinsic::alpha_uqtosfp },
+     { "llvm.alpha.dfptosq",   Intrinsic::alpha_dfptosq },
+     { "llvm.alpha.sfptosq",   Intrinsic::alpha_sfptosq },
   };
   const unsigned num_alpha_intrinsics = 
                  sizeof(alpha_intrinsics) / sizeof(*alpha_intrinsics);
@@ -204,17 +206,17 @@ unsigned Function::getIntrinsicID() const {
           return alpha_intrinsics[i].id;
     break;
   case 'l':
-    if (getName() == "llvm.longjmp")  return LLVMIntrinsic::longjmp;
+    if (getName() == "llvm.longjmp")  return Intrinsic::longjmp;
     break;
   case 's':
-    if (getName() == "llvm.setjmp")     return LLVMIntrinsic::setjmp;
-    if (getName() == "llvm.sigsetjmp")  return LLVMIntrinsic::sigsetjmp;
-    if (getName() == "llvm.siglongjmp") return LLVMIntrinsic::siglongjmp;
+    if (getName() == "llvm.setjmp")     return Intrinsic::setjmp;
+    if (getName() == "llvm.sigsetjmp")  return Intrinsic::sigsetjmp;
+    if (getName() == "llvm.siglongjmp") return Intrinsic::siglongjmp;
     break;
   case 'v':
-    if (getName() == "llvm.va_copy")  return LLVMIntrinsic::va_copy;
-    if (getName() == "llvm.va_end")   return LLVMIntrinsic::va_end;
-    if (getName() == "llvm.va_start") return LLVMIntrinsic::va_start;
+    if (getName() == "llvm.va_copy")  return Intrinsic::va_copy;
+    if (getName() == "llvm.va_end")   return Intrinsic::va_end;
+    if (getName() == "llvm.va_start") return Intrinsic::va_start;
     break;
   }
   // The "llvm." namespace is reserved!
@@ -257,3 +259,5 @@ void GlobalVariable::setName(const std::string &name, SymbolTable *ST) {
   Value::setName(name);
   if (P && getName() != "") P->getSymbolTable().insert(this);
 }
+
+} // End llvm namespace
index ba1d4b71608e82975440fc03ed7f8b2aef41f897..17e16fa733fd675cca42b7e1de0211678a429bbf 100644 (file)
@@ -19,6 +19,8 @@
 #include "llvm/Type.h"
 #include <algorithm>  // find
 
+namespace llvm {
+
 //===----------------------------------------------------------------------===//
 //                            TerminatorInst Class
 //===----------------------------------------------------------------------===//
@@ -56,3 +58,5 @@ Value *PHINode::removeIncomingValue(unsigned Idx, bool DeletePHIIfEmpty) {
   }
   return Removed;
 }
+
+} // End llvm namespace
index b72656bdc232bee0490fc076ca063ae68b39f4c5..9ca2fedbf4f83afecbb21af0ace6d1820231a42c 100644 (file)
@@ -16,6 +16,8 @@
 #include "llvm/Type.h"
 #include "Support/LeakDetector.h"
 
+namespace llvm {
+
 Instruction::Instruction(const Type *ty, unsigned it, const std::string &Name,
                          Instruction *InsertBefore)
   : User(ty, Value::InstructionVal, Name) {
@@ -163,3 +165,5 @@ bool Instruction::isTrapping(unsigned op) {
     return false;
   }
 }
+
+} // End llvm namespace
index 24c946ab6ea4109b9af889abda3b565cea1c2f23..ffb081a998201e696db07fe1ef726faa8e757d6b 100644 (file)
@@ -15,6 +15,8 @@
 #include "llvm/Value.h"
 #include <set>
 
+namespace llvm {
+
 // Lazily allocate set so that release build doesn't have to do anything.
 static std::set<const void*> *Objects = 0;
 static std::set<const Value*> *LLVMObjects = 0;
@@ -87,3 +89,5 @@ void LeakDetector::checkForGarbageImpl(const std::string &Message) {
     Objects = 0; LLVMObjects = 0;
   }
 }
+
+} // End llvm namespace
index 0be840fb6cd8189df793db59ab5325435e788857..4bc78a4cde3c5b3d39066e3c58fab6f5717ac139 100644 (file)
@@ -23,6 +23,8 @@
 #include "llvm/iOther.h"
 #include "llvm/Constants.h"
 
+namespace llvm {
+
 // Error - Simple wrapper function to conditionally assign to E and return true.
 // This just makes error return conditions a little bit simpler...
 //
@@ -902,3 +904,4 @@ bool LinkModules(Module *Dest, const Module *Src, std::string *ErrorMsg) {
   return false;
 }
 
+} // End llvm namespace
index 44c697d3d8fa9eda235d518f826400bd2f29bf41..567fe05e3202aecf3d11d9831be348c8a2b3d19d 100644 (file)
@@ -16,6 +16,8 @@
 #include "llvm/Type.h"
 #include "Support/StringExtras.h"
 
+namespace llvm {
+
 static char HexDigit(int V) {
   return V < 10 ? V+'0' : V+'A'-10;
 }
@@ -99,3 +101,4 @@ Mangler::Mangler(Module &m, bool addUnderscorePrefix)
         FoundNames.insert(I->getName());   // Otherwise, keep track of name
 }
 
+} // End llvm namespace
index e62c83f67a658b7d1131c9bc8eb1f2ada58e0fde..6b15929506eaba23ba823b6182cd38fb2b8d37ca 100644 (file)
@@ -22,6 +22,8 @@
 #include <cstdarg>
 #include <map>
 
+namespace llvm {
+
 Function *ilist_traits<Function>::createNode() {
   FunctionType *FTy =
     FunctionType::get(Type::VoidTy, std::vector<const Type*>(), false);
@@ -307,3 +309,5 @@ void Module::mutateConstantPointerRef(GlobalValue *OldGV, GlobalValue *NewGV) {
     delete Ref;
   }
 }
+
+} // End llvm namespace
index ba324d089413685342a12bcbd568f11afe554825..8be033622dfd41d53a1be371719c73490966cc6a 100644 (file)
@@ -14,6 +14,8 @@
 #include "llvm/ModuleProvider.h"
 #include "llvm/Module.h"
 
+namespace llvm {
+
 /// ctor - always have a valid Module
 ///
 ModuleProvider::ModuleProvider() : TheModule(0) { }
@@ -35,3 +37,5 @@ Module* ModuleProvider::materializeModule() {
 
   return TheModule;
 }
+
+} // End llvm namespace
index 96ad3c94e98f5788e5719b71cf2628fee373f944..b387fc352405035c4b863b0f962ed2ddfd247997 100644 (file)
@@ -21,6 +21,8 @@
 #include "Support/TypeInfo.h"
 #include <set>
 
+namespace llvm {
+
 // IncludeFile - Stub function used to help linking out.
 IncludeFile::IncludeFile(void*) {}
 
@@ -467,3 +469,5 @@ void PassRegistrationListener::enumeratePasses() {
            E = PassInfoMap->end(); I != E; ++I)
       passEnumerate(I->second);
 }
+
+} // End llvm namespace
index a715f5148e5e9e92ccebdc7abb025a3dd4e9c763..c5cac1d7fef36a92e0fee780ac6e5487484434ee 100644 (file)
@@ -28,6 +28,9 @@
 #include "Support/Timer.h"
 #include <algorithm>
 #include <iostream>
+
+namespace llvm {
+
 class Annotable;
 
 //===----------------------------------------------------------------------===//
@@ -792,4 +795,6 @@ inline bool PassManagerTraits<Function>::doFinalization(Module &M) {
   return Changed;
 }
 
+} // End llvm namespace
+
 #endif
index aef71763c44dd7f4ab82ccca5325235fb79dc73d..c6e44e8266f35d07c3710a72a8412a43d1498ad8 100644 (file)
@@ -27,6 +27,8 @@
 #include "Support/STLExtras.h"
 #include <algorithm>
 
+namespace llvm {
+
 #if 0
 #define SC_DEBUG(X) std::cerr << X
 #else
@@ -361,3 +363,5 @@ int SlotCalculator::doInsertValue(const Value *D) {
   SC_DEBUG("]\n");
   return (int)DestSlot;
 }
+
+} // End llvm namespace
index 9452cdfec4397ec2473b823cf1568ceaacc0265e..834d6198982071eb60699d53ee14a7b3667b346d 100644 (file)
@@ -17,6 +17,8 @@
 #include "Support/StringExtras.h"
 #include <algorithm>
 
+namespace llvm {
+
 #define DEBUG_SYMBOL_TABLE 0
 #define DEBUG_ABSTYPE 0
 
@@ -354,3 +356,5 @@ void SymbolTable::dump() const {
   std::cout << "Symbol table dump:\n";
   for_each(begin(), end(), DumpPlane);
 }
+
+} // End llvm namespace
index aec7520cef1e4a54f623fbe55385b5803d815130..22d2e1d6c7a4d1f449161713d02905a566bc1b56 100644 (file)
@@ -19,6 +19,8 @@
 #include "llvm/SymbolTableListTraits.h"
 #include "llvm/SymbolTable.h"
 
+namespace llvm {
+
 template<typename ValueSubClass, typename ItemParentClass,typename SymTabClass,
          typename SubClass>
 void SymbolTableListTraits<ValueSubClass,ItemParentClass,SymTabClass,SubClass>
@@ -94,4 +96,6 @@ void SymbolTableListTraits<ValueSubClass,ItemParentClass,SymTabClass,SubClass>
   }
 }
 
+} // End llvm namespace
+
 #endif
index ed468022cb83647a1c7347c1ad495dcc6664d23e..9e33303b7f2c26333347dcf5730a2732f825c4da 100644 (file)
@@ -18,6 +18,8 @@
 #include "Support/STLExtras.h"
 #include <algorithm>
 
+namespace llvm {
+
 // DEBUG_MERGE_TYPES - Enable this #define to see how and when derived types are
 // created and later destroyed, all in an effort to make sure that there is only
 // a single canonical version of a type.
@@ -1114,3 +1116,4 @@ void PointerType::typeBecameConcrete(const DerivedType *AbsTy) {
   refineAbstractType(AbsTy, AbsTy);
 }
 
+} // End llvm namespace
index 709ae3e9aeda4a146a206f866514045da3fbeded..f389eb0132f54ad605474d4d130aedacaa215186 100644 (file)
@@ -18,6 +18,8 @@
 #include "Support/LeakDetector.h"
 #include <algorithm>
 
+namespace llvm {
+
 //===----------------------------------------------------------------------===//
 //                                Value Class
 //===----------------------------------------------------------------------===//
@@ -107,3 +109,5 @@ void User::replaceUsesOfWith(Value *From, Value *To) {
       setOperand(i, To); // Fix it now...
     }
 }
+
+} // End llvm namespace
index 14c14f3c089cddc4f71a6621d9e605c0dcbd40a6..1362eaab0f6bd80f0a1617147ba7b2def4d3fc9f 100644 (file)
@@ -57,6 +57,8 @@
 #include "Support/STLExtras.h"
 #include <algorithm>
 
+namespace llvm {
+
 namespace {  // Anonymous namespace for class
 
   struct Verifier : public FunctionPass, InstVisitor<Verifier> {
@@ -149,7 +151,7 @@ namespace {  // Anonymous namespace for class
     void visitReturnInst(ReturnInst &RI);
     void visitUserOp1(Instruction &I);
     void visitUserOp2(Instruction &I) { visitUserOp1(I); }
-    void visitIntrinsicFunctionCall(LLVMIntrinsic::ID ID, CallInst &CI);
+    void visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI);
 
     // CheckFailed - A check failed, so print out the condition and the message
     // that failed.  This provides a nice place to put a breakpoint if you want
@@ -168,7 +170,6 @@ namespace {  // Anonymous namespace for class
   };
 
   RegisterPass<Verifier> X("verify", "Module Verifier");
-}
 
 // Assert - We know that cond should be true, if not print an error message.
 #define Assert(C, M) \
@@ -368,7 +369,7 @@ void Verifier::visitCallInst(CallInst &CI) {
             CI.getOperand(i+1), FTy->getParamType(i));
 
   if (Function *F = CI.getCalledFunction())
-    if (LLVMIntrinsic::ID ID = (LLVMIntrinsic::ID)F->getIntrinsicID())
+    if (Intrinsic::ID ID = (Intrinsic::ID)F->getIntrinsicID())
       visitIntrinsicFunctionCall(ID, CI);
 
   visitInstruction(CI);
@@ -500,7 +501,7 @@ void Verifier::visitInstruction(Instruction &I) {
 }
 
 /// visitIntrinsicFunction - Allow intrinsics to be verified in different ways.
-void Verifier::visitIntrinsicFunctionCall(LLVMIntrinsic::ID ID, CallInst &CI) {
+void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) {
   Function *IF = CI.getCalledFunction();
   const FunctionType *FT = IF->getFunctionType();
   Assert1(IF->isExternal(), "Intrinsic functions should never be defined!", IF);
@@ -509,37 +510,37 @@ void Verifier::visitIntrinsicFunctionCall(LLVMIntrinsic::ID ID, CallInst &CI) {
   // FIXME: this should check the return type of each intrinsic as well, also
   // arguments!
   switch (ID) {
-  case LLVMIntrinsic::va_start:
+  case Intrinsic::va_start:
     Assert1(CI.getParent()->getParent()->getFunctionType()->isVarArg(),
             "llvm.va_start intrinsic may only occur in function with variable"
             " args!", &CI);
     NumArgs = 0;
     break;
-  case LLVMIntrinsic::va_end:          NumArgs = 1; break;
-  case LLVMIntrinsic::va_copy:         NumArgs = 1; break;
+  case Intrinsic::va_end:          NumArgs = 1; break;
+  case Intrinsic::va_copy:         NumArgs = 1; break;
 
-  case LLVMIntrinsic::setjmp:          NumArgs = 1; break;
-  case LLVMIntrinsic::longjmp:         NumArgs = 2; break;
-  case LLVMIntrinsic::sigsetjmp:       NumArgs = 2; break;
-  case LLVMIntrinsic::siglongjmp:      NumArgs = 2; break;
+  case Intrinsic::setjmp:          NumArgs = 1; break;
+  case Intrinsic::longjmp:         NumArgs = 2; break;
+  case Intrinsic::sigsetjmp:       NumArgs = 2; break;
+  case Intrinsic::siglongjmp:      NumArgs = 2; break;
  
-  case LLVMIntrinsic::alpha_ctlz:      NumArgs = 1; break;
-  case LLVMIntrinsic::alpha_cttz:      NumArgs = 1; break;
-  case LLVMIntrinsic::alpha_ctpop:     NumArgs = 1; break;
-  case LLVMIntrinsic::alpha_umulh:     NumArgs = 2; break;
-  case LLVMIntrinsic::alpha_vecop:     NumArgs = 4; break;
-  case LLVMIntrinsic::alpha_pup:       NumArgs = 3; break;
-  case LLVMIntrinsic::alpha_bytezap:   NumArgs = 2; break;
-  case LLVMIntrinsic::alpha_bytemanip: NumArgs = 3; break;
-  case LLVMIntrinsic::alpha_dfpbop:    NumArgs = 3; break;
-  case LLVMIntrinsic::alpha_dfpuop:    NumArgs = 2; break;
-  case LLVMIntrinsic::alpha_unordered: NumArgs = 2; break;
-  case LLVMIntrinsic::alpha_uqtodfp:   NumArgs = 2; break;
-  case LLVMIntrinsic::alpha_uqtosfp:   NumArgs = 2; break;
-  case LLVMIntrinsic::alpha_dfptosq:   NumArgs = 2; break;
-  case LLVMIntrinsic::alpha_sfptosq:   NumArgs = 2; break;
-
-  case LLVMIntrinsic::not_intrinsic: 
+  case Intrinsic::alpha_ctlz:      NumArgs = 1; break;
+  case Intrinsic::alpha_cttz:      NumArgs = 1; break;
+  case Intrinsic::alpha_ctpop:     NumArgs = 1; break;
+  case Intrinsic::alpha_umulh:     NumArgs = 2; break;
+  case Intrinsic::alpha_vecop:     NumArgs = 4; break;
+  case Intrinsic::alpha_pup:       NumArgs = 3; break;
+  case Intrinsic::alpha_bytezap:   NumArgs = 2; break;
+  case Intrinsic::alpha_bytemanip: NumArgs = 3; break;
+  case Intrinsic::alpha_dfpbop:    NumArgs = 3; break;
+  case Intrinsic::alpha_dfpuop:    NumArgs = 2; break;
+  case Intrinsic::alpha_unordered: NumArgs = 2; break;
+  case Intrinsic::alpha_uqtodfp:   NumArgs = 2; break;
+  case Intrinsic::alpha_uqtosfp:   NumArgs = 2; break;
+  case Intrinsic::alpha_dfptosq:   NumArgs = 2; break;
+  case Intrinsic::alpha_sfptosq:   NumArgs = 2; break;
+
+  case Intrinsic::not_intrinsic: 
     assert(0 && "Invalid intrinsic!"); NumArgs = 0; break;
   }
 
@@ -548,6 +549,7 @@ void Verifier::visitIntrinsicFunctionCall(LLVMIntrinsic::ID ID, CallInst &CI) {
           "Illegal # arguments for intrinsic function!", IF);
 }
 
+} // End anonymous namespace
 
 //===----------------------------------------------------------------------===//
 //  Implement the public interfaces to this file...
@@ -585,3 +587,5 @@ bool verifyModule(const Module &M) {
   PM.run((Module&)M);
   return V->Broken;
 }
+
+} // End llvm namespace
index bcba7145cc067fce813ec0ddb252d9f739ed59a6..59dc303d70103856fe85b1764db47cd029b2f10c 100644 (file)
@@ -16,6 +16,8 @@
 #include "llvm/BasicBlock.h"
 #include "llvm/Type.h"
 
+namespace llvm {
+
 BranchInst::BranchInst(BasicBlock *True, BasicBlock *False, Value *Cond,
                        Instruction *InsertBefore) 
   : TerminatorInst(Instruction::Br, InsertBefore) {
@@ -49,3 +51,5 @@ BranchInst::BranchInst(const BranchInst &BI) : TerminatorInst(Instruction::Br) {
     Operands.push_back(Use(BI.Operands[2], this));
   }
 }
+
+} // End llvm namespace
index b99c9e7bb3f7483c7220efba2affa8d5a2df7614..c385afc778bc4625a5493ead712331c7fa98cbed 100644 (file)
@@ -17,6 +17,8 @@
 #include "llvm/DerivedTypes.h"
 #include "llvm/Function.h"
 
+namespace llvm {
+
 //===----------------------------------------------------------------------===//
 //                        CallInst Implementation
 //===----------------------------------------------------------------------===//
@@ -144,8 +146,12 @@ Function *InvokeInst::getCalledFunction() {
   return 0;
 }
 
+} // End llvm namespace
+
 #include "llvm/Support/CallSite.h"
 
+namespace llvm {
+
 Function *CallSite::getCalledFunction() const {
   Value *Callee = getCalledValue();
   if (Function *F = dyn_cast<Function>(Callee))
@@ -155,3 +161,4 @@ Function *CallSite::getCalledFunction() const {
   return 0;
 }
 
+} // End llvm namespace
index 75309ad8dc048b081a853d954f56c2bdcc5ffc91..c1a06576cd4c1f5860aa2549c5e991840bb525bc 100644 (file)
@@ -15,6 +15,8 @@
 #include "llvm/Constants.h"
 #include "llvm/DerivedTypes.h"
 
+using namespace llvm;
+
 AllocationInst::AllocationInst(const Type *Ty, Value *ArraySize, unsigned iTy, 
                                const std::string &Name, Instruction *InsertBef)
   : Instruction(PointerType::get(Ty), iTy, Name, InsertBef) {
index d8932901981fddb349022b77c9211935d850ec09..79fac335fe54635f53ea9c9033f6d99aef7b153d 100644 (file)
@@ -16,6 +16,8 @@
 #include "llvm/Constants.h"
 #include "llvm/BasicBlock.h"
 
+namespace llvm {
+
 //===----------------------------------------------------------------------===//
 //                             BinaryOperator Class
 //===----------------------------------------------------------------------===//
@@ -194,3 +196,5 @@ Instruction::BinaryOps SetCondInst::getSwappedCondition(BinaryOps Opcode) {
   case SetLE: return SetGE;
   }
 }
+
+} // End llvm namespace
index e6a4f48ef49cffeb82177145c8a503455660249c..4386b7b837ce02eaec7a842855f2c3128cb8f418 100644 (file)
@@ -14,6 +14,8 @@
 #include "llvm/iTerminators.h"
 #include "llvm/BasicBlock.h"
 
+namespace llvm {
+
 SwitchInst::SwitchInst(Value *V, BasicBlock *DefaultDest,
                        Instruction *InsertBefore) 
   : TerminatorInst(Instruction::Switch, InsertBefore) {
@@ -48,3 +50,5 @@ void SwitchInst::removeCase(unsigned idx) {
   assert(idx*2 < Operands.size() && "Successor index out of range!!!");
   Operands.erase(Operands.begin()+idx*2, Operands.begin()+(idx+1)*2);  
 }
+
+} // End llvm namespace
index 1d06c2d0dd0f880022a1254614cdfc332f883304..a1b68449f3bad7d743ac5a21221845cc6896b7d2 100644 (file)
@@ -12,6 +12,8 @@
 #include "llvm/Instructions.h"
 #include "llvm/Bytecode/Writer.h"
 
+using namespace llvm;
+
 int main() {
   // Create the "module" or "program" or "translation unit" to hold the
   // function
index 1d06c2d0dd0f880022a1254614cdfc332f883304..a1b68449f3bad7d743ac5a21221845cc6896b7d2 100644 (file)
@@ -12,6 +12,8 @@
 #include "llvm/Instructions.h"
 #include "llvm/Bytecode/Writer.h"
 
+using namespace llvm;
+
 int main() {
   // Create the "module" or "program" or "translation unit" to hold the
   // function
index 6c4c99f5a3055bf2b5f3e20907be479c77bbb72c..a9b9cd0470cccb18ea7519011fbebbee863e7e53 100644 (file)
@@ -26,6 +26,8 @@
 #include "llvm/Analysis/LoopInfo.h"
 #include "llvm/Support/InstIterator.h"
 
+using namespace llvm;
+
 namespace {
   struct InstForestHelper : public FunctionPass {
     Function *F;
index 34c937f0d4d52b6db556871a36eeb8df567fcdd7..6d2750f5e2eb2931b9683e1e5863c4fb8aab08a3 100644 (file)
@@ -20,6 +20,8 @@
 #include "llvm/Analysis/CallGraph.h"
 #include <fstream>
 
+namespace llvm {
+
 template<typename GraphType>
 static void WriteGraphToFile(std::ostream &O, const std::string &GraphName,
                              const GraphType &GT) {
@@ -72,3 +74,5 @@ namespace {
   RegisterAnalysis<CallGraphPrinter> P2("print-callgraph",
                                         "Print Call Graph to 'dot' file");
 };
+
+} // End llvm namespace
index 345938115871d51c33e3c40d3fa8e4b2cd81a853..ce89fff90e6104a947c38f979b50bbb403cdc64c 100644 (file)
@@ -31,6 +31,8 @@
 #include "llvm/Support/CFG.h"
 #include "Support/SCCIterator.h"
 
+namespace llvm {
+
 namespace {
   struct CFGSCC : public FunctionPass {
     bool runOnFunction(Function& func);
@@ -101,3 +103,5 @@ bool CallGraphSCC::run(Module &M) {
 
   return true;
 }
+
+} // End llvm namespace
index 836b6aa8d7217e28e9c36b679cb21323b1e624f8..3e1e51600e8b2d85645220ece8f5d8992e2bde41 100644 (file)
@@ -26,6 +26,7 @@
 #include "Support/Timer.h"
 #include <algorithm>
 
+using namespace llvm;
 
 struct ModulePassPrinter : public Pass {
   const PassInfo *PassToPrint;
index f0fb785db9c171c0ee2a77fe56e8125710a840e0..12843588c881c4e4dd24642b2d1bd34d5d1af456 100644 (file)
@@ -23,6 +23,8 @@
 #include "Support/FileUtilities.h"
 #include <memory>
 
+using namespace llvm;
+
 // Anonymous namespace to define command line options for debugging.
 //
 namespace {
@@ -36,6 +38,8 @@ namespace {
                                 "(for miscompilation detection)"));
 }
 
+namespace llvm {
+
 /// getPassesString - Turn a list of passes into a string which indicates the
 /// command line options that must be passed to add the passes.
 ///
@@ -179,3 +183,5 @@ void BugDriver::PrintFunctionList(const std::vector<Function*> &Funcs) {
   }
   std::cout << std::flush;
 }
+
+} // End llvm namespace
index e1af721a75cb37d2172c0314e8ff9bc26343bc7b..af04a7d61a894db23c2c5c27be7d52367d9a58fe 100644 (file)
@@ -19,6 +19,8 @@
 #include <vector>
 #include <string>
 
+namespace llvm {
+
 class PassInfo;
 class Module;
 class Function;
@@ -207,4 +209,6 @@ std::string getPassesString(const std::vector<const PassInfo*> &Passes);
 //
 void DeleteFunctionBody(Function *F);
 
+} // End llvm namespace
+
 #endif
index 41df79a110a96f16eb964ecb13d695442ddba681..b24620ea140b1403c056fb3f146c9c06415d035c 100644 (file)
@@ -33,6 +33,8 @@
 #include <algorithm>
 #include <set>
 
+namespace llvm {
+
 extern cl::list<std::string> InputArgv;
 
 class ReduceMisCodegenFunctions : public ListReducer<Function*> {
@@ -408,3 +410,5 @@ bool BugDriver::debugCodeGenerator() {
 
   return false;
 }
+
+} // End llvm namespace
index 0b2851f220ce0f86b82580147398885fff8e9548..8c29ea226a43d645642f7455b378e6bb2bb4548d 100644 (file)
@@ -29,6 +29,8 @@
 #include <fstream>
 #include <set>
 
+namespace llvm {
+
 class DebugCrashes : public ListReducer<const PassInfo*> {
   BugDriver &BD;
 public:
@@ -397,3 +399,5 @@ bool BugDriver::debugCrash() {
 
   return false;
 }
+
+} // End llvm namespace
index 596aeb95a887934a2563034b1a15a42f3458f4b4..9a3bd55055561dda83dc425ef5d78fb3397bcb80 100644 (file)
@@ -30,6 +30,8 @@ BUGPOINT NOTES:
 #include <fstream>
 #include <iostream>
 
+using namespace llvm;
+
 namespace {
   // OutputType - Allow the user to specify the way code should be run, to test
   // for miscompilation.
@@ -58,6 +60,8 @@ namespace {
                          "into executing programs"));
 }
 
+namespace llvm {
+
 // Anything specified after the --args option are taken as arguments to the
 // program being debugged.
 cl::list<std::string>
@@ -232,3 +236,5 @@ bool BugDriver::diffProgram(const std::string &BytecodeFile,
 bool BugDriver::isExecutingJIT() {
   return InterpreterSel == RunJIT;
 }
+
+} // End llvm namespace
index 38e25864e4ce609c0b137be83d82a4e179e259b6..4c671be62fae65b79253e901aa4a244f2a293775 100644 (file)
 #include "llvm/Target/TargetData.h"
 #include "Support/CommandLine.h"
 
+
+namespace llvm {
+
 bool DisableSimplifyCFG = false;
 
+} // End llvm namespace
+
+using namespace llvm;
+
 namespace {
   cl::opt<bool>
   NoADCE("disable-adce",
@@ -39,6 +46,8 @@ namespace {
          cl::desc("Do not use the -simplifycfg pass to reduce testcases"));
 }
 
+namespace llvm {
+
 /// deleteInstructionFromProgram - This method clones the current Program and
 /// deletes the specified instruction from the cloned module.  It then runs a
 /// series of cleanup passes (ADCE and SimplifyCFG) to eliminate any code which
@@ -125,3 +134,5 @@ Module *BugDriver::performFinalCleanups(Module *M, bool MayModifySemantics) {
   }
   return M;
 }
+
+} // End llvm namespace
index 0ab2ef9927ac5787efbd91215839c23dbf69e47f..0ad24065cf3cf9e7fea34852e710df1aa2a97ba3 100644 (file)
@@ -17,6 +17,8 @@
 
 #include <vector>
 
+namespace llvm {
+
 template<typename ElTy>
 struct ListReducer {
   enum TestResult {
@@ -109,4 +111,6 @@ struct ListReducer {
   }
 };
 
+} // End llvm namespace
+
 #endif
index 5ec8b1543e36ac8cec8974c3c72990bc58b468ea..1fb46a62bcb71051205d18e976c974f82623df93 100644 (file)
@@ -19,6 +19,8 @@
 #include "llvm/Transforms/Utils/Linker.h"
 #include "Support/FileUtilities.h"
 
+namespace llvm {
+
 class ReduceMiscompilingPasses : public ListReducer<const PassInfo*> {
   BugDriver &BD;
 public:
@@ -308,3 +310,5 @@ bool BugDriver::debugMiscompilation() {
 
   return false;
 }
+
+} // End llvm namespace
index 600a25ad723b7b2a6d08d2412461914693fff78b..af9d1e5a9453a5680a1cf982874f6a86f524d718 100644 (file)
@@ -26,6 +26,8 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 
+namespace llvm {
+
 /// writeProgramToFile - This writes the current "Program" to the named bytecode
 /// file.  If an error occurs, true is returned.
 ///
@@ -159,3 +161,5 @@ bool BugDriver::runPasses(const std::vector<const PassInfo*> &Passes,
   // Was the child successful?
   return !ExitedOK;
 }
+
+} // End llvm namespace
index af5c045788a724123eb63356480ef8154b622b5d..ee2c0d7248310c4a65196ae366ae81d1d32af6cf 100644 (file)
@@ -18,6 +18,8 @@
 #include "llvm/Pass.h"
 #include "llvm/Support/InstVisitor.h"
 
+using namespace llvm;
+
 namespace {
   /// CrashOnCalls - This pass is used to test bugpoint.  It intentionally
   /// crashes on any call instructions.
index a66b868c22cdc5f064c888b2816b8f6810ea0e7a..50a9ad21c8598bdf1993adfed2e25d6d7e087f1a 100644 (file)
@@ -18,6 +18,8 @@
 #include <iostream>
 #include <fstream>
 
+namespace llvm {
+
 //===---------------------------------------------------------------------===//
 // LLI Implementation of AbstractIntepreter interface
 //
@@ -391,3 +393,5 @@ GCC *GCC::create(const std::string &ProgramPath, std::string &Message) {
   Message = "Found gcc: " + GCCPath + "\n";
   return new GCC(GCCPath);
 }
+
+} // End llvm namespace
index e23ec7f312d65ae043a1836c47457965d79a50c9..8ce3f5d8f37cce65c77a63f8f230b2f02d4c3b62 100644 (file)
@@ -20,6 +20,8 @@
 #include "Support/SystemUtils.h"
 #include <vector>
 
+namespace llvm {
+
 class CBE;
 class LLC;
 
@@ -137,4 +139,6 @@ public:
   int OutputAsm(const std::string &Bytecode, std::string &OutputAsmFile);
 };
 
+} // End llvm namespace
+
 #endif
index 8f55804e0cbc093c40a420b45ec0442c30a984ef..9bca7fd6fcb5c9edf2b42d05c6d035eea813decb 100644 (file)
@@ -19,6 +19,8 @@
 #include "Config/unistd.h"
 #include <sys/resource.h>
 
+using namespace llvm;
+
 static cl::list<std::string>
 InputFilenames(cl::Positional, cl::OneOrMore,
                cl::desc("<input llvm ll/bc files>"));
index 272d473180893bac6e649bebfaf443017b9d573d..72412b8b09831d11ac872c4b40e548167db56775 100644 (file)
@@ -21,6 +21,8 @@
 #include "Support/CommandLine.h"
 #include <memory>
 
+using namespace llvm;
+
 // InputFilename - The filename to read from.
 static cl::opt<std::string>
 InputFilename(cl::Positional, cl::desc("<input bytecode file>"),
index d97c716da1e901406e79a61d98e10f7f43d76a46..c7a2204e32dffd966eda4eb7dc238cdc64d1970a 100644 (file)
@@ -27,6 +27,8 @@
 #include <memory>
 #include <fstream>
 
+using namespace llvm;
+
 namespace {
   cl::opt<std::string>
   InputFilename(cl::Positional,cl::desc("<input llvm assembly>"),cl::init("-"));
index bf32400c6348c4298abce134e1453f4e36ff155d..aac1f93d32fbbba537e28eb7e5c672693f86b63f 100644 (file)
 #include "Support/SystemUtils.h"
 #include "Support/CommandLine.h"
 
+using namespace llvm;
+
 namespace {
   cl::opt<bool>
   DisableInline("disable-inlining", cl::desc("Do not run the inliner pass"));
 }
 
+namespace llvm {
 
 /// GenerateBytecode - generates a bytecode file from the specified module.
 ///
@@ -221,3 +224,5 @@ GenerateNative(const std::string &OutputFilename,
   // Run the compiler to assembly and link together the program.
   return ExecWait(&(cmd[0]), clean_env);
 }
+
+} // End llvm namespace
index 06f0635749bdb5b155039444cc8ffaa7b6a6270a..9c228917754b0a9ec8dd8175f7551a83d5aaae6d 100644 (file)
@@ -30,6 +30,8 @@
 #include <memory>
 #include <set>
 
+namespace llvm {
+
 /// FindLib - Try to convert Filename into the name of a file that we can open,
 /// if it does not already name a file we can open, by first trying to open
 /// Filename, then libFilename.<suffix> for each of a set of several common
@@ -405,3 +407,5 @@ bool LinkLibraries(const char *progname,
 
   return false;
 }
+
+} // End llvm namespace
index 45163f439685e28fe91d9e51cf71247a8ce44e9f..5a1b26100a9d7551d5d59422eb6612886db7cb89 100644 (file)
@@ -36,6 +36,8 @@
 #include <fstream>
 #include <memory>
 
+using namespace llvm;
+
 namespace {
   cl::list<std::string> 
   InputFilenames(cl::Positional, cl::desc("<input bytecode files>"),
@@ -86,6 +88,8 @@ namespace {
   CO5("eh-frame-hdr", cl::Hidden, cl::desc("Compatibility option: ignored"));
 }
 
+namespace llvm {
+
 //
 // Function: PrintAndReturn ()
 //
@@ -211,6 +215,7 @@ void RemoveEnv(const char * name, char ** const envp) {
   return;
 }
 
+} // End llvm namespace
 
 int main(int argc, char **argv, char **envp) {
   cl::ParseCommandLineOptions(argc, argv, " llvm linker for GCC\n");
index e3c5504209503f016abb883eb32560532764370f..9b7eb1e87731e5331ce143d0c1e3d9f789306f9e 100644 (file)
@@ -17,6 +17,8 @@
 #include <set>
 #include <ostream>
 
+namespace llvm {
+
 int
 PrintAndReturn (const char *progname,
                 const std::string &Message,
@@ -69,3 +71,4 @@ LinkFiles (const char * progname,
            const std::vector<std::string> & Files,
            bool Verbose);
 
+} // End llvm namespace
index 0143d086e7496bed17aa3cb7d4c9d5b84cfb9194..f219b6ea16116e783e05d9b9263586d108a5ebfb 100644 (file)
@@ -23,6 +23,8 @@
 #include <memory>
 #include <fstream>
 
+using namespace llvm;
+
 // General options for llc.  Other pass-specific options are specified
 // within the corresponding llc passes, and target-specific options
 // and back-end code generation options are specified with the target machine.
index 87fe461ce0d744a4fea39729595868f5102149ce..82b354dc18a516879ba085a4255c7201720d9068 100644 (file)
@@ -28,6 +28,8 @@
 #include "Support/Debug.h"
 #include "Support/SystemUtils.h"
 
+using namespace llvm;
+
 namespace {
   cl::opt<std::string>
   InputFile(cl::desc("<input bytecode>"), cl::Positional, cl::init("-"));
index 879d847630fc940e3cb253016161f9b3d47a1634..e9a4dbf0951b56c67cc5b00986ccddcc65710fa7 100644 (file)
@@ -25,6 +25,8 @@
 #include <unistd.h>
 #include <sys/mman.h>
 
+using namespace llvm;
+
 using std::string;
 using std::vector;
 using std::cout;
@@ -69,7 +71,7 @@ namespace {
 
 //Option to generate symbol table or not
 //running llvm-ar -s is the same as ranlib
-cl::opt<bool> SymbolTable ("s", cl::desc("Generate an archive symbol table"));
+cl::opt<bool> SymbolTableOption ("s", cl::desc("Generate an archive symbol table"));
 
 //Archive name
 cl::opt<string> Archive (cl::Positional, cl::desc("<archive file>"), 
@@ -335,7 +337,7 @@ void CreateArchive() {
   ArchiveFile << ARMAG;
 
   //If the '-s' option was specified, generate symbol table.
-  if(SymbolTable) {
+  if(SymbolTableOption) {
     cout << "Symbol Table Start: " << ArchiveFile.tellp() << "\n";
     if(!WriteSymbolTable(ArchiveFile)) {
       std::cerr << "Error creating symbol table. Exiting program.";
index 0905466780ccba33a31eb30f0780c66a06d5f1d2..9be5afff116134165b76f36d36627cb0776cf94c 100644 (file)
@@ -24,6 +24,8 @@
 #include <fstream>
 #include <memory>
 
+using namespace llvm;
+
 static cl::opt<std::string> 
 InputFilename(cl::Positional, cl::desc("<input .llvm file>"), cl::init("-"));
 
index 915755903bf560c3ccd58e5a64a7f33ea52b91dc..8d0ca7bc2daad52dccdfc14071d81afd51343aa9 100644 (file)
 
 // OutputMode - The different orderings to print basic blocks in...
 enum OutputMode {
-  llvm = 0,           // Generate LLVM assembly (the default)
+  LLVM = 0,           // Generate LLVM assembly (the default)
   c,                  // Generate C code
 };
 
+using namespace llvm;
+
 static cl::opt<std::string>
 InputFilename(cl::Positional, cl::desc("<input bytecode>"), cl::init("-"));
 
@@ -45,8 +47,8 @@ Force("f", cl::desc("Overwrite output files"));
 
 static cl::opt<enum OutputMode>
 WriteMode(cl::desc("Specify the output format:"),
-          cl::values(clEnumVal(llvm, "Output LLVM assembly"),
-                     clEnumVal(c   , "Output C code for program"),
+          cl::values(clEnumVal(LLVM, "Output LLVM assembly"),
+                     clEnumVal(c, "Output C code for program"),
                     0));
 
 int main(int argc, char **argv) {
@@ -116,7 +118,7 @@ int main(int argc, char **argv) {
   PassManager Passes;
 
   switch (WriteMode) {
-  case llvm:           // Output LLVM assembly
+  case LLVM:           // Output LLVM assembly
     Passes.add(new PrintModulePass(Out));
     break;
   case c:              // Convert LLVM to C
index 272d473180893bac6e649bebfaf443017b9d573d..72412b8b09831d11ac872c4b40e548167db56775 100644 (file)
@@ -21,6 +21,8 @@
 #include "Support/CommandLine.h"
 #include <memory>
 
+using namespace llvm;
+
 // InputFilename - The filename to read from.
 static cl::opt<std::string>
 InputFilename(cl::Positional, cl::desc("<input bytecode file>"),
index 764b59b43f85174fbb411de7fcf27d115ca1d0d9..3b492145163e2b89823225b2c5e5d7551d14d991 100644 (file)
@@ -24,6 +24,8 @@
 #include <sys/types.h>     // For FileExists
 #include <sys/stat.h>
 
+using namespace llvm;
+
 static cl::list<std::string>
 InputFilenames(cl::Positional, cl::OneOrMore,
                cl::desc("<input bytecode files>"));
index f7a0ef6746504752724398dbf7240c4e340c54c2..878aa24f432e664a935a66bf65b5c63eaf486fb1 100644 (file)
@@ -21,6 +21,8 @@
 #include "Support/CommandLine.h"
 #include <cctype>
 
+using namespace llvm;
+
 namespace {
   enum OutputFormatTy { bsd, sysv, posix };
   cl::opt<OutputFormatTy>
index 78de9c16c7ae6098947a2c09caa71243769fc4ac..1d37c4291a642c0a4f9511c69210c0c1d1ef1e7b 100644 (file)
@@ -20,6 +20,8 @@
 #include <fcntl.h>
 #include <stdio.h>
 
+using namespace llvm;
+
 enum ProfilingType {
   ArgumentInfo = 1,   // The command line argument block
   FunctionInfo = 2,   // Function profiling information
index 24e42961565cb8344ff1ad18cf38a8db91050f44..db4500127df62f061a5a81d0deb3bd8e8c7d64a2 100644 (file)
@@ -18,6 +18,9 @@
 #include <vector>
 #include <string>
 #include <utility>
+
+namespace llvm {
+
 class Module;
 class Function;
 class BasicBlock;
@@ -55,4 +58,6 @@ public:
   void getBlockCounts(std::vector<std::pair<BasicBlock*, unsigned> > &Counts);
 };
 
+} // End llvm namespace
+
 #endif
index 4492fd67b7196b1ddc88c0fb597488047cd938a0..438fecf07a4a7ca5c5212f82b729a58be4f24f58 100644 (file)
@@ -23,6 +23,8 @@
 #include <map>
 #include <set>
 
+using namespace llvm;
+
 namespace {
   cl::opt<std::string> 
   BytecodeFile(cl::Positional, cl::desc("<program bytecode file>"),
index 6c4c99f5a3055bf2b5f3e20907be479c77bbb72c..a9b9cd0470cccb18ea7519011fbebbee863e7e53 100644 (file)
@@ -26,6 +26,8 @@
 #include "llvm/Analysis/LoopInfo.h"
 #include "llvm/Support/InstIterator.h"
 
+using namespace llvm;
+
 namespace {
   struct InstForestHelper : public FunctionPass {
     Function *F;
index 34c937f0d4d52b6db556871a36eeb8df567fcdd7..6d2750f5e2eb2931b9683e1e5863c4fb8aab08a3 100644 (file)
@@ -20,6 +20,8 @@
 #include "llvm/Analysis/CallGraph.h"
 #include <fstream>
 
+namespace llvm {
+
 template<typename GraphType>
 static void WriteGraphToFile(std::ostream &O, const std::string &GraphName,
                              const GraphType &GT) {
@@ -72,3 +74,5 @@ namespace {
   RegisterAnalysis<CallGraphPrinter> P2("print-callgraph",
                                         "Print Call Graph to 'dot' file");
 };
+
+} // End llvm namespace
index 345938115871d51c33e3c40d3fa8e4b2cd81a853..ce89fff90e6104a947c38f979b50bbb403cdc64c 100644 (file)
@@ -31,6 +31,8 @@
 #include "llvm/Support/CFG.h"
 #include "Support/SCCIterator.h"
 
+namespace llvm {
+
 namespace {
   struct CFGSCC : public FunctionPass {
     bool runOnFunction(Function& func);
@@ -101,3 +103,5 @@ bool CallGraphSCC::run(Module &M) {
 
   return true;
 }
+
+} // End llvm namespace
index bc0a5fcb6fb5a765c0742470d8fca616bc406893..30c72f1c9e806cf416945c9163a2dd67751fd952 100644 (file)
@@ -27,6 +27,7 @@
 #include <memory>
 #include <algorithm>
 
+using namespace llvm;
 
 // The OptimizationList is automatically populated with registered Passes by the
 // PassNameParser.
index bd3d2ffea57c7555a68d30567720923765b4793c..2c3e374b16610813665afc2847bed8125a965248 100644 (file)
@@ -15,6 +15,8 @@
 #include "Record.h"
 #include "Support/Debug.h"
 
+namespace llvm {
+
 void CodeEmitterGen::run(std::ostream &o) {
   std::vector<Record*> Insts = Records.getAllDerivedDefinitions("Instruction");
 
@@ -221,4 +223,8 @@ void CodeEmitterGen::run(std::ostream &o) {
     << "  }\n"
     << "  return Value;\n"
     << "}\n";
+
+  EmitSourceFileTail(o);
 }
+
+} // End llvm namespace
index d7b4bc1adff88875c45440139c54c201e470212d..19ca5452f5516e64f2d71eca1544f25651df747c 100644 (file)
@@ -16,6 +16,8 @@
 
 #include "TableGenBackend.h"
 
+namespace llvm {
+
 class CodeEmitterGen : public TableGenBackend {
   RecordKeeper &Records;
 public:
@@ -28,4 +30,6 @@ private:
   void emitGetValueBit(std::ostream &o, const std::string &Namespace);
 };
 
+} // End llvm namespace
+
 #endif
index 5039ccaad0ae7d2af979193e55905954ea71400b..bf641fa27677efcb7610e5f7429a406aaa49c508 100644 (file)
@@ -17,6 +17,8 @@
 #include "CodeGenWrappers.h"
 #include "Record.h"
 
+namespace llvm {
+
 /// getValueType - Return the MCV::ValueType that the specified TableGen record
 /// corresponds to.
 MVT::ValueType getValueType(Record *Rec) {
@@ -94,3 +96,5 @@ const std::string &CodeGenTarget::getName() const {
 Record *CodeGenTarget::getInstructionSet() const {
   return TargetRec->getValueAsDef("InstructionSet");
 }
+
+} // End llvm namespace
index f0b7200edc11771b263617860456da49804335f4..948360e2b11cce1821da048014f2039bb65a40a5 100644 (file)
@@ -21,6 +21,9 @@
 #include <iosfwd>
 #include <string>
 #include <vector>
+
+namespace llvm {
+
 class Record;
 class RecordKeeper;
 
@@ -60,4 +63,6 @@ public:
   // CodeGenInstructionSet *getInstructionSet -
 };
 
+} // End llvm namespace
+
 #endif
index 5039ccaad0ae7d2af979193e55905954ea71400b..bf641fa27677efcb7610e5f7429a406aaa49c508 100644 (file)
@@ -17,6 +17,8 @@
 #include "CodeGenWrappers.h"
 #include "Record.h"
 
+namespace llvm {
+
 /// getValueType - Return the MCV::ValueType that the specified TableGen record
 /// corresponds to.
 MVT::ValueType getValueType(Record *Rec) {
@@ -94,3 +96,5 @@ const std::string &CodeGenTarget::getName() const {
 Record *CodeGenTarget::getInstructionSet() const {
   return TargetRec->getValueAsDef("InstructionSet");
 }
+
+} // End llvm namespace
index f0b7200edc11771b263617860456da49804335f4..948360e2b11cce1821da048014f2039bb65a40a5 100644 (file)
@@ -21,6 +21,9 @@
 #include <iosfwd>
 #include <string>
 #include <vector>
+
+namespace llvm {
+
 class Record;
 class RecordKeeper;
 
@@ -60,4 +63,6 @@ public:
   // CodeGenInstructionSet *getInstructionSet -
 };
 
+} // End llvm namespace
+
 #endif
index 0858a8c5e44b0d869eefeeb94b1a036801155c60..48070b34a144124027ae9ca1818070eab46d06f5 100644 (file)
 
 %{
 #include "Record.h"
-typedef std::pair<Record*, std::vector<Init*>*> SubClassRefTy;
+typedef std::pair<llvm::Record*, std::vector<llvm::Init*>*> SubClassRefTy;
 #include "FileParser.h"
 
+int Fileparse();
+
+namespace llvm {
+
 // Global variable recording the location of the include directory
 std::string IncludeDirectory;
 
@@ -69,7 +73,6 @@ std::ostream &err() {
 }
 
 
-int Fileparse();
 
 //
 // Function: ParseFile()
@@ -171,6 +174,10 @@ int yywrap() {
   return 0;
 }
 
+} // End llvm namespace
+
+using namespace llvm;
+
 %}
 
 Comment      \/\/.*
index 491cca310d066dbff5647996c70084f006c6fb10..e95e59785c9e177c19f14adc1b6090a0b74e90c4 100644 (file)
@@ -20,6 +20,9 @@
 
 int yyerror(const char *ErrorMsg);
 int yylex();
+
+namespace llvm {
+
 extern int Filelineno;
 static Record *CurRec = 0;
 
@@ -160,20 +163,23 @@ static void addSubClass(Record *SC, const std::vector<Init*> &TemplateArgs) {
   addSuperClass(SC);
 }
 
+} // End llvm namespace
+
+using namespace llvm;
 
 %}
 
 %union {
-  std::string          *StrVal;
-  int                   IntVal;
-  RecTy                *Ty;
-  Init                 *Initializer;
-  std::vector<Init*>   *FieldList;
-  std::vector<unsigned>*BitList;
-  Record               *Rec;
-  SubClassRefTy        *SubClassRef;
-  std::vector<SubClassRefTy> *SubClassList;
-  std::vector<std::pair<Init*, std::string> > *DagValueList;
+  std::string*                StrVal;
+  int                         IntVal;
+  llvm::RecTy*                Ty;
+  llvm::Init*                 Initializer;
+  std::vector<llvm::Init*>*   FieldList;
+  std::vector<unsigned>*      BitList;
+  llvm::Record*               Rec;
+  SubClassRefTy*              SubClassRef;
+  std::vector<SubClassRefTy>SubClassList;
+  std::vector<std::pair<llvm::Init*, std::string> >* DagValueList;
 };
 
 %token INT BIT STRING BITS LIST CODE DAG CLASS DEF FIELD LET IN
@@ -193,6 +199,7 @@ static void addSubClass(Record *SC, const std::vector<Init*> &TemplateArgs) {
 %type <StrVal>       Declaration OptID OptVarName
 
 %start File
+
 %%
 
 ClassID : ID {
index a11244dd98835d6e843207d7d8b2fc5f73a2c302..ed040b15d9036f046081717e36d568fc8a47692b 100644 (file)
@@ -16,6 +16,8 @@
 #include "CodeGenWrappers.h"
 #include "Record.h"
 
+namespace llvm {
+
 // runEnums - Print out enum values for all of the instructions.
 void InstrInfoEmitter::runEnums(std::ostream &OS) {
   std::vector<Record*> Insts = Records.getAllDerivedDefinitions("Instruction");
@@ -47,6 +49,7 @@ void InstrInfoEmitter::runEnums(std::ostream &OS) {
   OS << "  };\n";
   if (!Namespace.empty())
     OS << "}\n";
+  EmitSourceFileTail(OS);
 }
 
 void InstrInfoEmitter::printDefList(ListInit *LI, const std::string &Name,
@@ -93,6 +96,7 @@ void InstrInfoEmitter::run(std::ostream &OS) {
     if (Instructions[i] != PHI)
       emitRecord(Instructions[i], i+1, InstrInfo, OS);
   OS << "};\n";
+  EmitSourceFileTail(OS);
 }
 
 void InstrInfoEmitter::emitRecord(Record *R, unsigned Num, Record *InstrInfo,
@@ -169,3 +173,5 @@ void InstrInfoEmitter::emitShiftedValue(Record *R, StringInit *Val,
   std::cerr << "Unhandled initializer: " << *Val << "\n";
   throw "In record '" + R->getName() + "' for TSFlag emission.";
 }
+
+} // End llvm namespace
index 4adac31264c46ab87f7d335efd8f833326520b0e..2a6b063debd7159f58214783bb94e9a54f3d4e4b 100644 (file)
@@ -16,6 +16,9 @@
 #define INSTRINFO_EMITTER_H
 
 #include "TableGenBackend.h"
+
+namespace llvm {
+
 class StringInit;
 class IntInit;
 class ListInit;
@@ -38,4 +41,6 @@ private:
                         std::ostream &OS);
 };
 
+} // End llvm namespace
+
 #endif
index 9988d55684b007398520d9c0a20b24599cb486eb..5d945bb841fc1efb824e3e1d4e4cc56b9ab4fe82 100644 (file)
@@ -19,6 +19,8 @@
 #include "Support/StringExtras.h"
 #include <set>
 
+namespace llvm {
+
 NodeType::ArgResultTypes NodeType::Translate(Record *R) {
   const std::string &Name = R->getName();
   if (Name == "DNVT_any")  return Any;
@@ -978,9 +980,10 @@ void InstrSelectorEmitter::run(std::ostream &OS) {
 
   CalculateComputableValues();
   
+  OS << "#include \"llvm/CodeGen/MachineInstrBuilder.h\"\n";
+
   EmitSourceFileHeader("Instruction Selector for the " + Target.getName() +
                        " target", OS);
-  OS << "#include \"llvm/CodeGen/MachineInstrBuilder.h\"\n";
 
   // Output the slot number enums...
   OS << "\nenum { // Slot numbers...\n"
@@ -1290,5 +1293,7 @@ void InstrSelectorEmitter::run(std::ostream &OS) {
        << "  }\n\n  N->addValue(Val);  // Do not ever recalculate this\n"
        << "  return Val;\n}\n\n";
   }
+  EmitSourceFileTail(OS);
 }
 
+} // End llvm namespace
index 2f9175c95a3189cfb4a5e2602d446e2da214f944..a0fbbcf408042586452cf1d48741bdabdb836e79 100644 (file)
@@ -21,6 +21,8 @@
 #include <map>
 #include <cassert>
 
+namespace llvm {
+
 class DagInit;
 class Init;
 class InstrSelectorEmitter;
@@ -391,4 +393,6 @@ private:
                             bool PrintArg, std::ostream &OS);
 };
 
+} // End llvm namespace
+
 #endif
index 32ffe6245a17360fd9dbdcd504d75d9d5b37d3de..00751a18244a701e0b5d3170ee72391f059d0024 100644 (file)
@@ -16,6 +16,8 @@
 //    Type implementations
 //===----------------------------------------------------------------------===//
 
+namespace llvm {
+
 void RecTy::dump() const { print(std::cerr); }
 
 Init *BitRecTy::convertValue(BitsInit *BI) {
@@ -681,3 +683,5 @@ RecordKeeper::getAllDerivedDefinitions(const std::string &ClassName) const {
 
   return Defs;
 }
+
+} // End llvm namespace
index e2233f88a847ce5a5023787489520f44ca1f36bb..d8a96495e76bb06b1ca721cd0d9210f8cda465f8 100644 (file)
@@ -21,6 +21,8 @@
 #include <iostream>
 #include <cassert>
 
+namespace llvm {
+
 // RecTy subclasses...
 class BitRecTy;
 class BitsRecTy;
@@ -853,4 +855,6 @@ std::ostream &operator<<(std::ostream &OS, const RecordKeeper &RK);
 
 extern RecordKeeper Records;
 
+} // End llvm namespace
+
 #endif
index 67acc3f33377dcb998992a0fae03def0c0f9d240..4e7aa9b5846d64f5597b506b61666d65920e52ad 100644 (file)
@@ -19,6 +19,8 @@
 #include "Support/StringExtras.h"
 #include <set>
 
+namespace llvm {
+
 // runEnums - Print out enum values for all of the registers.
 void RegisterInfoEmitter::runEnums(std::ostream &OS) {
   std::vector<Record*> Registers = Records.getAllDerivedDefinitions("Register");
@@ -40,6 +42,7 @@ void RegisterInfoEmitter::runEnums(std::ostream &OS) {
   OS << "  };\n";
   if (!Namespace.empty())
     OS << "}\n";
+  EmitSourceFileTail(OS);
 }
 
 void RegisterInfoEmitter::runHeader(std::ostream &OS) {
@@ -68,6 +71,7 @@ void RegisterInfoEmitter::runHeader(std::ostream &OS) {
       OS << "  extern TargetRegisterClass *" << Name << "RegisterClass;\n";
   }
   OS << "} // end of namespace " << TargetName << "\n\n";
+  EmitSourceFileTail(OS);
 }
 
 // RegisterInfoEmitter::run - Main register file description emitter.
@@ -240,4 +244,7 @@ void RegisterInfoEmitter::run(std::ostream &OS) {
   for (unsigned i = 0, e = CSR.size(); i != e; ++i)
     OS << getQualifiedName(CSR[i]) << ", ";  
   OS << " 0\n  };\n  return CalleeSaveRegs;\n}\n\n";
+  EmitSourceFileTail(OS);
 }
+
+} // End llvm namespace
index 22c759facfceee7a5830a4f91a6ee3e6f48f9d3c..1e6380b70a073db5d6f675d157766d0aceadc677 100644 (file)
@@ -18,6 +18,8 @@
 
 #include "TableGenBackend.h"
 
+namespace llvm {
+
 class RegisterInfoEmitter : public TableGenBackend {
   RecordKeeper &Records;
 public:
@@ -33,4 +35,6 @@ public:
   void runEnums(std::ostream &o);
 };
 
+} // End llvm namespace
+
 #endif
index 803d0f0fdd5bd2dd641a1ab89a8bf07a29a767a0..c05ccb0bb17cda99b5b2a86e679089284f5e25fa 100644 (file)
@@ -27,6 +27,8 @@
 #include <cstdio>
 #include <fstream>
 
+namespace llvm {
+
 enum ActionType {
   PrintRecords,
   GenEmitter,
@@ -406,6 +408,9 @@ static void ParseMachineCode() {
   }
 }
 
+} // End llvm namespace
+
+using namespace llvm;
 
 int main(int argc, char **argv) {
   cl::ParseCommandLineOptions(argc, argv);
@@ -459,12 +464,17 @@ int main(int argc, char **argv) {
       InstrSelectorEmitter(Records).run(*Out);
       break;
     case PrintEnums:
+    {
       std::vector<Record*> Recs = Records.getAllDerivedDefinitions(Class);
       for (unsigned i = 0, e = Recs.size(); i != e; ++i)
         *Out << Recs[i] << ", ";
       *Out << "\n";
       break;
     }
+    default:
+      assert(1 && "Invalid Action");
+      return 1;
+    }
   } catch (const std::string &Error) {
     std::cerr << Error << "\n";
     if (Out != &std::cout) {
index 161b2eeb607e7458a284fd0ea53f4043f4fc341e..67a37885db1a7d21df92f79cdd410709008b7124 100644 (file)
 #include "Record.h"
 #include <iostream>
 
+namespace llvm {
+
 void TableGenBackend::EmitSourceFileHeader(const std::string &Desc,
                                            std::ostream &OS) const {
   OS << "//===- TableGen'erated file -------------------------------------*-"
        " C++ -*-===//\n//\n// " << Desc << "\n//\n// Automatically generate"
        "d file, do not edit!\n//\n//===------------------------------------"
-       "----------------------------------===//\n\n";
+       "----------------------------------===//\n\nnamespace llvm {\n\n";
+}
+
+void TableGenBackend::EmitSourceFileTail( std::ostream& OS ) const {
+  OS << "} // End llvm namespace \n";
 }
 
 /// getQualifiedName - Return the name of the specified record, with a
@@ -32,3 +38,4 @@ std::string TableGenBackend::getQualifiedName(Record *R) const {
   return Namespace + "::" + R->getName();
 }
 
+} // End llvm namespace
index 23b83cac7ea68c0a4d6da6f4725a4ba137737df6..869d7e939d738a6cc8fac0bf13305ebc564d5453 100644 (file)
@@ -17,6 +17,9 @@
 
 #include <string>
 #include <iosfwd>
+
+namespace llvm {
+
 class Record;
 class RecordKeeper;
 
@@ -33,9 +36,15 @@ public:   // Useful helper routines...
   /// ostream.
   void EmitSourceFileHeader(const std::string &Desc, std::ostream &OS) const;
 
+  /// EmitSourceFileTail - Output an LLVm styelf ile tail to the specified
+  /// ostream.
+  void EmitSourceFileTail( std::ostream& OS ) const;
+
   /// getQualifiedName - Return the name of the specified record, with a
   /// namespace qualifier if the record contains one.
   std::string getQualifiedName(Record *R) const;
 };
 
+} // End llvm namespace
+
 #endif