diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2003-11-11 22:41:34 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2003-11-11 22:41:34 +0000 |
commit | d0fde30ce850b78371fd1386338350591f9ff494 (patch) | |
tree | 83bb73e83f54fc8e1e474d116250ae2779562f7e /include/llvm | |
parent | 0d723acf15b0326e2df09ecb614b02a617f536e4 (diff) | |
download | llvm-d0fde30ce850b78371fd1386338350591f9ff494.tar.gz llvm-d0fde30ce850b78371fd1386338350591f9ff494.tar.bz2 llvm-d0fde30ce850b78371fd1386338350591f9ff494.tar.xz |
Put all LLVM code into the llvm namespace, as per bug 109.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
162 files changed, 722 insertions, 22 deletions
diff --git a/include/llvm/ADT/BitSetVector.h b/include/llvm/ADT/BitSetVector.h index 08bafa1580..72f55b38c4 100644 --- a/include/llvm/ADT/BitSetVector.h +++ b/include/llvm/ADT/BitSetVector.h @@ -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 diff --git a/include/llvm/ADT/DepthFirstIterator.h b/include/llvm/ADT/DepthFirstIterator.h index bb7673c83d..c465f4e549 100644 --- a/include/llvm/ADT/DepthFirstIterator.h +++ b/include/llvm/ADT/DepthFirstIterator.h @@ -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 diff --git a/include/llvm/ADT/EquivalenceClasses.h b/include/llvm/ADT/EquivalenceClasses.h index 01e8c5ef82..46e626b69b 100644 --- a/include/llvm/ADT/EquivalenceClasses.h +++ b/include/llvm/ADT/EquivalenceClasses.h @@ -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 diff --git a/include/llvm/ADT/GraphTraits.h b/include/llvm/ADT/GraphTraits.h index 305f71e280..4ff74176a7 100644 --- a/include/llvm/ADT/GraphTraits.h +++ b/include/llvm/ADT/GraphTraits.h @@ -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 diff --git a/include/llvm/ADT/PostOrderIterator.h b/include/llvm/ADT/PostOrderIterator.h index 9309554f32..d66c4b84c4 100644 --- a/include/llvm/ADT/PostOrderIterator.h +++ b/include/llvm/ADT/PostOrderIterator.h @@ -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 diff --git a/include/llvm/ADT/SCCIterator.h b/include/llvm/ADT/SCCIterator.h index cf137cd473..f21c7d162e 100644 --- a/include/llvm/ADT/SCCIterator.h +++ b/include/llvm/ADT/SCCIterator.h @@ -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 diff --git a/include/llvm/ADT/STLExtras.h b/include/llvm/ADT/STLExtras.h index 28c46e3d99..06a15734a7 100644 --- a/include/llvm/ADT/STLExtras.h +++ b/include/llvm/ADT/STLExtras.h @@ -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 diff --git a/include/llvm/ADT/SetOperations.h b/include/llvm/ADT/SetOperations.h index dc6e0d6029..bb1e68e6b2 100644 --- a/include/llvm/ADT/SetOperations.h +++ b/include/llvm/ADT/SetOperations.h @@ -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 diff --git a/include/llvm/ADT/Statistic.h b/include/llvm/ADT/Statistic.h index d69809ff18..4e592d5832 100644 --- a/include/llvm/ADT/Statistic.h +++ b/include/llvm/ADT/Statistic.h @@ -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 diff --git a/include/llvm/ADT/StringExtras.h b/include/llvm/ADT/StringExtras.h index 2c50c1cd5b..2ebac81935 100644 --- a/include/llvm/ADT/StringExtras.h +++ b/include/llvm/ADT/StringExtras.h @@ -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 diff --git a/include/llvm/ADT/Tree.h b/include/llvm/ADT/Tree.h index e6454317a8..bc5495f25a 100644 --- a/include/llvm/ADT/Tree.h +++ b/include/llvm/ADT/Tree.h @@ -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 diff --git a/include/llvm/ADT/VectorExtras.h b/include/llvm/ADT/VectorExtras.h index 32778309d4..cf7cf5d2eb 100644 --- a/include/llvm/ADT/VectorExtras.h +++ b/include/llvm/ADT/VectorExtras.h @@ -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 diff --git a/include/llvm/ADT/ilist b/include/llvm/ADT/ilist index 488a90ffde..7f4d2659d5 100644 --- a/include/llvm/ADT/ilist +++ b/include/llvm/ADT/ilist @@ -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... diff --git a/include/llvm/AbstractTypeUser.h b/include/llvm/AbstractTypeUser.h index 9e3edddbc2..8a18f5896c 100644 --- a/include/llvm/AbstractTypeUser.h +++ b/include/llvm/AbstractTypeUser.h @@ -37,6 +37,8 @@ // #include <cassert> +namespace llvm { + class Type; class DerivedType; @@ -165,4 +167,6 @@ private: void dropRef(); }; +} // End llvm namespace + #endif diff --git a/include/llvm/Analysis/AliasAnalysis.h b/include/llvm/Analysis/AliasAnalysis.h index 4ce3f4baf1..dc484f5df5 100644 --- a/include/llvm/Analysis/AliasAnalysis.h +++ b/include/llvm/Analysis/AliasAnalysis.h @@ -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 diff --git a/include/llvm/Analysis/AliasSetTracker.h b/include/llvm/Analysis/AliasSetTracker.h index 72168b4756..fe57c28679 100644 --- a/include/llvm/Analysis/AliasSetTracker.h +++ b/include/llvm/Analysis/AliasSetTracker.h @@ -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 diff --git a/include/llvm/Analysis/CallGraph.h b/include/llvm/Analysis/CallGraph.h index 3a51b05655..60649f9ed9 100644 --- a/include/llvm/Analysis/CallGraph.h +++ b/include/llvm/Analysis/CallGraph.h @@ -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 diff --git a/include/llvm/Analysis/ConstantsScanner.h b/include/llvm/Analysis/ConstantsScanner.h index c7efd76cef..e1533c35bb 100644 --- a/include/llvm/Analysis/ConstantsScanner.h +++ b/include/llvm/Analysis/ConstantsScanner.h @@ -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 diff --git a/include/llvm/Analysis/DSGraph.h b/include/llvm/Analysis/DSGraph.h index 399da007e2..b7fdb10af5 100644 --- a/include/llvm/Analysis/DSGraph.h +++ b/include/llvm/Analysis/DSGraph.h @@ -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 diff --git a/include/llvm/Analysis/DSGraphTraits.h b/include/llvm/Analysis/DSGraphTraits.h index 086835cb92..ad2cc6fa8f 100644 --- a/include/llvm/Analysis/DSGraphTraits.h +++ b/include/llvm/Analysis/DSGraphTraits.h @@ -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 diff --git a/include/llvm/Analysis/DSNode.h b/include/llvm/Analysis/DSNode.h index ba5328b2b8..f206c3e5ad 100644 --- a/include/llvm/Analysis/DSNode.h +++ b/include/llvm/Analysis/DSNode.h @@ -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 diff --git a/include/llvm/Analysis/DSSupport.h b/include/llvm/Analysis/DSSupport.h index e5662ff0a4..4b571917ff 100644 --- a/include/llvm/Analysis/DSSupport.h +++ b/include/llvm/Analysis/DSSupport.h @@ -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 diff --git a/include/llvm/Analysis/DataStructure.h b/include/llvm/Analysis/DataStructure.h index afea126c07..4d6e3a0476 100644 --- a/include/llvm/Analysis/DataStructure.h +++ b/include/llvm/Analysis/DataStructure.h @@ -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 diff --git a/include/llvm/Analysis/DataStructure/DSGraph.h b/include/llvm/Analysis/DataStructure/DSGraph.h index 399da007e2..b7fdb10af5 100644 --- a/include/llvm/Analysis/DataStructure/DSGraph.h +++ b/include/llvm/Analysis/DataStructure/DSGraph.h @@ -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 diff --git a/include/llvm/Analysis/DataStructure/DSGraphTraits.h b/include/llvm/Analysis/DataStructure/DSGraphTraits.h index 086835cb92..ad2cc6fa8f 100644 --- a/include/llvm/Analysis/DataStructure/DSGraphTraits.h +++ b/include/llvm/Analysis/DataStructure/DSGraphTraits.h @@ -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 diff --git a/include/llvm/Analysis/DataStructure/DSNode.h b/include/llvm/Analysis/DataStructure/DSNode.h index ba5328b2b8..f206c3e5ad 100644 --- a/include/llvm/Analysis/DataStructure/DSNode.h +++ b/include/llvm/Analysis/DataStructure/DSNode.h @@ -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 diff --git a/include/llvm/Analysis/DataStructure/DSSupport.h b/include/llvm/Analysis/DataStructure/DSSupport.h index e5662ff0a4..4b571917ff 100644 --- a/include/llvm/Analysis/DataStructure/DSSupport.h +++ b/include/llvm/Analysis/DataStructure/DSSupport.h @@ -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 diff --git a/include/llvm/Analysis/DataStructure/DataStructure.h b/include/llvm/Analysis/DataStructure/DataStructure.h index afea126c07..4d6e3a0476 100644 --- a/include/llvm/Analysis/DataStructure/DataStructure.h +++ b/include/llvm/Analysis/DataStructure/DataStructure.h @@ -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 diff --git a/include/llvm/Analysis/DependenceGraph.h b/include/llvm/Analysis/DependenceGraph.h index b5af0b9e25..b4c7aa1fcc 100644 --- a/include/llvm/Analysis/DependenceGraph.h +++ b/include/llvm/Analysis/DependenceGraph.h @@ -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 diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h index b8ac9c3e11..5688d6e811 100644 --- a/include/llvm/Analysis/Dominators.h +++ b/include/llvm/Analysis/Dominators.h @@ -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 diff --git a/include/llvm/Analysis/Expressions.h b/include/llvm/Analysis/Expressions.h index 29207618d1..77475ffa6c 100644 --- a/include/llvm/Analysis/Expressions.h +++ b/include/llvm/Analysis/Expressions.h @@ -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 diff --git a/include/llvm/Analysis/FindUnsafePointerTypes.h b/include/llvm/Analysis/FindUnsafePointerTypes.h index 8f1cdcf094..62077f37d5 100644 --- a/include/llvm/Analysis/FindUnsafePointerTypes.h +++ b/include/llvm/Analysis/FindUnsafePointerTypes.h @@ -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 diff --git a/include/llvm/Analysis/FindUsedTypes.h b/include/llvm/Analysis/FindUsedTypes.h index a246084dbb..69471791ab 100644 --- a/include/llvm/Analysis/FindUsedTypes.h +++ b/include/llvm/Analysis/FindUsedTypes.h @@ -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 diff --git a/include/llvm/Analysis/IPModRef.h b/include/llvm/Analysis/IPModRef.h index 84e55195e5..cf70d5835e 100644 --- a/include/llvm/Analysis/IPModRef.h +++ b/include/llvm/Analysis/IPModRef.h @@ -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 diff --git a/include/llvm/Analysis/InductionVariable.h b/include/llvm/Analysis/InductionVariable.h index 26deb832f8..6c06a6c065 100644 --- a/include/llvm/Analysis/InductionVariable.h +++ b/include/llvm/Analysis/InductionVariable.h @@ -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 diff --git a/include/llvm/Analysis/InstForest.h b/include/llvm/Analysis/InstForest.h index a034c92d51..82fc46e1d1 100644 --- a/include/llvm/Analysis/InstForest.h +++ b/include/llvm/Analysis/InstForest.h @@ -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 diff --git a/include/llvm/Analysis/Interval.h b/include/llvm/Analysis/Interval.h index 9839cf5dc0..0d5912305b 100644 --- a/include/llvm/Analysis/Interval.h +++ b/include/llvm/Analysis/Interval.h @@ -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 diff --git a/include/llvm/Analysis/IntervalIterator.h b/include/llvm/Analysis/IntervalIterator.h index 2d67ded196..091959f25f 100644 --- a/include/llvm/Analysis/IntervalIterator.h +++ b/include/llvm/Analysis/IntervalIterator.h @@ -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 diff --git a/include/llvm/Analysis/IntervalPartition.h b/include/llvm/Analysis/IntervalPartition.h index 45e282acdf..408ace2e7e 100644 --- a/include/llvm/Analysis/IntervalPartition.h +++ b/include/llvm/Analysis/IntervalPartition.h @@ -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 diff --git a/include/llvm/Analysis/LoadValueNumbering.h b/include/llvm/Analysis/LoadValueNumbering.h index 83aa5e99a6..6218133a51 100644 --- a/include/llvm/Analysis/LoadValueNumbering.h +++ b/include/llvm/Analysis/LoadValueNumbering.h @@ -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 diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h index 6a96834a15..1458b3bd5f 100644 --- a/include/llvm/Analysis/LoopInfo.h +++ b/include/llvm/Analysis/LoopInfo.h @@ -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 diff --git a/include/llvm/Analysis/MemoryDepAnalysis.h b/include/llvm/Analysis/MemoryDepAnalysis.h index 6ecc3c8250..10eb6566b6 100644 --- a/include/llvm/Analysis/MemoryDepAnalysis.h +++ b/include/llvm/Analysis/MemoryDepAnalysis.h @@ -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 diff --git a/include/llvm/Analysis/PgmDependenceGraph.h b/include/llvm/Analysis/PgmDependenceGraph.h index edb5119f00..70128740a8 100644 --- a/include/llvm/Analysis/PgmDependenceGraph.h +++ b/include/llvm/Analysis/PgmDependenceGraph.h @@ -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 diff --git a/include/llvm/Analysis/PostDominators.h b/include/llvm/Analysis/PostDominators.h index b1a9b8ed16..c8eb439b41 100644 --- a/include/llvm/Analysis/PostDominators.h +++ b/include/llvm/Analysis/PostDominators.h @@ -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 diff --git a/include/llvm/Analysis/SlotCalculator.h b/include/llvm/Analysis/SlotCalculator.h index 7e56de99dc..596f9324ed 100644 --- a/include/llvm/Analysis/SlotCalculator.h +++ b/include/llvm/Analysis/SlotCalculator.h @@ -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 diff --git a/include/llvm/Analysis/ValueNumbering.h b/include/llvm/Analysis/ValueNumbering.h index ff4680d663..74b5c97ff2 100644 --- a/include/llvm/Analysis/ValueNumbering.h +++ b/include/llvm/Analysis/ValueNumbering.h @@ -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 diff --git a/include/llvm/Analysis/Verifier.h b/include/llvm/Analysis/Verifier.h index 427015c6c6..51da3a5eae 100644 --- a/include/llvm/Analysis/Verifier.h +++ b/include/llvm/Analysis/Verifier.h @@ -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 diff --git a/include/llvm/Argument.h b/include/llvm/Argument.h index 2d70f5314b..ab4ee1bf0e 100644 --- a/include/llvm/Argument.h +++ b/include/llvm/Argument.h @@ -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 diff --git a/include/llvm/Assembly/AsmAnnotationWriter.h b/include/llvm/Assembly/AsmAnnotationWriter.h index 192cb3de0b..3beda6df03 100644 --- a/include/llvm/Assembly/AsmAnnotationWriter.h +++ b/include/llvm/Assembly/AsmAnnotationWriter.h @@ -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 diff --git a/include/llvm/Assembly/CWriter.h b/include/llvm/Assembly/CWriter.h index cc7a358a9b..3029787ca4 100644 --- a/include/llvm/Assembly/CWriter.h +++ b/include/llvm/Assembly/CWriter.h @@ -16,7 +16,12 @@ #define LLVM_ASSEMBLY_CWRITER_H #include <iosfwd> + +namespace llvm { + class Pass; Pass *createWriteToCPass(std::ostream &o); +} // End llvm namespace + #endif diff --git a/include/llvm/Assembly/CachedWriter.h b/include/llvm/Assembly/CachedWriter.h index dbddacde93..4acd3de4da 100644 --- a/include/llvm/Assembly/CachedWriter.h +++ b/include/llvm/Assembly/CachedWriter.h @@ -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 diff --git a/include/llvm/Assembly/Parser.h b/include/llvm/Assembly/Parser.h index 4f1863f071..dc1b17eb50 100644 --- a/include/llvm/Assembly/Parser.h +++ b/include/llvm/Assembly/Parser.h @@ -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 diff --git a/include/llvm/Assembly/PrintModulePass.h b/include/llvm/Assembly/PrintModulePass.h index e211e8bdae..28100805a7 100644 --- a/include/llvm/Assembly/PrintModulePass.h +++ b/include/llvm/Assembly/PrintModulePass.h @@ -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 diff --git a/include/llvm/Assembly/Writer.h b/include/llvm/Assembly/Writer.h index 5798ae8ac7..9f89b3192f 100644 --- a/include/llvm/Assembly/Writer.h +++ b/include/llvm/Assembly/Writer.h @@ -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 diff --git a/include/llvm/BasicBlock.h b/include/llvm/BasicBlock.h index 1a996bcf26..9f78bc7467 100644 --- a/include/llvm/BasicBlock.h +++ b/include/llvm/BasicBlock.h @@ -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 diff --git a/include/llvm/Bytecode/Format.h b/include/llvm/Bytecode/Format.h index 79cf9f0527..380f4df0ab 100644 --- a/include/llvm/Bytecode/Format.h +++ b/include/llvm/Bytecode/Format.h @@ -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 diff --git a/include/llvm/Bytecode/Primitives.h b/include/llvm/Bytecode/Primitives.h index d9b29c00e7..3973eceadb 100644 --- a/include/llvm/Bytecode/Primitives.h +++ b/include/llvm/Bytecode/Primitives.h @@ -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 diff --git a/include/llvm/Bytecode/Reader.h b/include/llvm/Bytecode/Reader.h index 0de71002a7..1e9fa32bd1 100644 --- a/include/llvm/Bytecode/Reader.h +++ b/include/llvm/Bytecode/Reader.h @@ -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 diff --git a/include/llvm/Bytecode/WriteBytecodePass.h b/include/llvm/Bytecode/WriteBytecodePass.h index ba8bc71c4c..b8863e6b47 100644 --- a/include/llvm/Bytecode/WriteBytecodePass.h +++ b/include/llvm/Bytecode/WriteBytecodePass.h @@ -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 diff --git a/include/llvm/Bytecode/Writer.h b/include/llvm/Bytecode/Writer.h index ba82f6ad19..9fadddb66b 100644 --- a/include/llvm/Bytecode/Writer.h +++ b/include/llvm/Bytecode/Writer.h @@ -26,7 +26,11 @@ #include <iosfwd> +namespace llvm { + class Module; void WriteBytecodeToFile(const Module *C, std::ostream &Out); +} // End llvm namespace + #endif diff --git a/include/llvm/CallGraphSCCPass.h b/include/llvm/CallGraphSCCPass.h index bb97a277cc..86cdc29f57 100644 --- a/include/llvm/CallGraphSCCPass.h +++ b/include/llvm/CallGraphSCCPass.h @@ -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 diff --git a/include/llvm/CodeGen/FunctionLiveVarInfo.h b/include/llvm/CodeGen/FunctionLiveVarInfo.h index e79d58f7e4..23a9d93a6e 100644 --- a/include/llvm/CodeGen/FunctionLiveVarInfo.h +++ b/include/llvm/CodeGen/FunctionLiveVarInfo.h @@ -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 diff --git a/include/llvm/CodeGen/InstrForest.h b/include/llvm/CodeGen/InstrForest.h index fc82d7c165..48266715bd 100644 --- a/include/llvm/CodeGen/InstrForest.h +++ b/include/llvm/CodeGen/InstrForest.h @@ -29,16 +29,24 @@ #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 diff --git a/include/llvm/CodeGen/InstrScheduling.h b/include/llvm/CodeGen/InstrScheduling.h index 40ce442f55..816aa7e806 100644 --- a/include/llvm/CodeGen/InstrScheduling.h +++ b/include/llvm/CodeGen/InstrScheduling.h @@ -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 diff --git a/include/llvm/CodeGen/InstrSelection.h b/include/llvm/CodeGen/InstrSelection.h index 89e827d106..2f269ea2d5 100644 --- a/include/llvm/CodeGen/InstrSelection.h +++ b/include/llvm/CodeGen/InstrSelection.h @@ -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 diff --git a/include/llvm/CodeGen/InstrSelectionSupport.h b/include/llvm/CodeGen/InstrSelectionSupport.h index 2ab23c756c..c1fba48615 100644 --- a/include/llvm/CodeGen/InstrSelectionSupport.h +++ b/include/llvm/CodeGen/InstrSelectionSupport.h @@ -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 diff --git a/include/llvm/CodeGen/LiveVariables.h b/include/llvm/CodeGen/LiveVariables.h index 8d1306e061..3a0d044c59 100644 --- a/include/llvm/CodeGen/LiveVariables.h +++ b/include/llvm/CodeGen/LiveVariables.h @@ -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 diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h index b3959e81a7..b8a0361f7f 100644 --- a/include/llvm/CodeGen/MachineBasicBlock.h +++ b/include/llvm/CodeGen/MachineBasicBlock.h @@ -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 diff --git a/include/llvm/CodeGen/MachineCodeEmitter.h b/include/llvm/CodeGen/MachineCodeEmitter.h index 4145851006..2d01f45d70 100644 --- a/include/llvm/CodeGen/MachineCodeEmitter.h +++ b/include/llvm/CodeGen/MachineCodeEmitter.h @@ -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 diff --git a/include/llvm/CodeGen/MachineCodeForInstruction.h b/include/llvm/CodeGen/MachineCodeForInstruction.h index d421f3e971..9a08de79af 100644 --- a/include/llvm/CodeGen/MachineCodeForInstruction.h +++ b/include/llvm/CodeGen/MachineCodeForInstruction.h @@ -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 diff --git a/include/llvm/CodeGen/MachineConstantPool.h b/include/llvm/CodeGen/MachineConstantPool.h index 441a43a9b9..edfd601faa 100644 --- a/include/llvm/CodeGen/MachineConstantPool.h +++ b/include/llvm/CodeGen/MachineConstantPool.h @@ -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 diff --git a/include/llvm/CodeGen/MachineFrameInfo.h b/include/llvm/CodeGen/MachineFrameInfo.h index 48b91012e0..e48158e1b5 100644 --- a/include/llvm/CodeGen/MachineFrameInfo.h +++ b/include/llvm/CodeGen/MachineFrameInfo.h @@ -38,12 +38,19 @@ #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 diff --git a/include/llvm/CodeGen/MachineFunction.h b/include/llvm/CodeGen/MachineFunction.h index 7474a6e29a..60478cfe5a 100644 --- a/include/llvm/CodeGen/MachineFunction.h +++ b/include/llvm/CodeGen/MachineFunction.h @@ -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 diff --git a/include/llvm/CodeGen/MachineFunctionInfo.h b/include/llvm/CodeGen/MachineFunctionInfo.h index db73322278..fdf135b16b 100644 --- a/include/llvm/CodeGen/MachineFunctionInfo.h +++ b/include/llvm/CodeGen/MachineFunctionInfo.h @@ -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 diff --git a/include/llvm/CodeGen/MachineFunctionPass.h b/include/llvm/CodeGen/MachineFunctionPass.h index 6975b5e785..390dcb8562 100644 --- a/include/llvm/CodeGen/MachineFunctionPass.h +++ b/include/llvm/CodeGen/MachineFunctionPass.h @@ -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 diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index fc886d97f5..2eb373f462 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -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 diff --git a/include/llvm/CodeGen/MachineInstrAnnot.h b/include/llvm/CodeGen/MachineInstrAnnot.h index 98dde590b8..19d93ab56a 100644 --- a/include/llvm/CodeGen/MachineInstrAnnot.h +++ b/include/llvm/CodeGen/MachineInstrAnnot.h @@ -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 diff --git a/include/llvm/CodeGen/MachineInstrBuilder.h b/include/llvm/CodeGen/MachineInstrBuilder.h index 14c7fe041f..67255214a2 100644 --- a/include/llvm/CodeGen/MachineInstrBuilder.h +++ b/include/llvm/CodeGen/MachineInstrBuilder.h @@ -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 diff --git a/include/llvm/CodeGen/Passes.h b/include/llvm/CodeGen/Passes.h index 807257e2c5..11fcf29013 100644 --- a/include/llvm/CodeGen/Passes.h +++ b/include/llvm/CodeGen/Passes.h @@ -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 diff --git a/include/llvm/CodeGen/SSARegMap.h b/include/llvm/CodeGen/SSARegMap.h index 7f5d5f97e5..c31911c91b 100644 --- a/include/llvm/CodeGen/SSARegMap.h +++ b/include/llvm/CodeGen/SSARegMap.h @@ -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 diff --git a/include/llvm/CodeGen/SchedGraphCommon.h b/include/llvm/CodeGen/SchedGraphCommon.h index 874e53d994..a422d9ae0d 100644 --- a/include/llvm/CodeGen/SchedGraphCommon.h +++ b/include/llvm/CodeGen/SchedGraphCommon.h @@ -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 diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h index f132f7b0a2..4719bf9d21 100644 --- a/include/llvm/CodeGen/SelectionDAG.h +++ b/include/llvm/CodeGen/SelectionDAG.h @@ -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 diff --git a/include/llvm/CodeGen/ValueSet.h b/include/llvm/CodeGen/ValueSet.h index 149506550d..f4bc6e80d4 100644 --- a/include/llvm/CodeGen/ValueSet.h +++ b/include/llvm/CodeGen/ValueSet.h @@ -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 diff --git a/include/llvm/CodeGen/ValueTypes.h b/include/llvm/CodeGen/ValueTypes.h index dc85ee0d3c..b523b71a14 100644 --- a/include/llvm/CodeGen/ValueTypes.h +++ b/include/llvm/CodeGen/ValueTypes.h @@ -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 diff --git a/include/llvm/Constant.h b/include/llvm/Constant.h index ac4c82090d..fbed6ee0fb 100644 --- a/include/llvm/Constant.h +++ b/include/llvm/Constant.h @@ -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 diff --git a/include/llvm/ConstantHandling.h b/include/llvm/ConstantHandling.h index a27283c440..a0a01e5306 100644 --- a/include/llvm/ConstantHandling.h +++ b/include/llvm/ConstantHandling.h @@ -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 diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index 077c61c6d5..5d65b2f0c7 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -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 diff --git a/include/llvm/DerivedTypes.h b/include/llvm/DerivedTypes.h index 8efe2695a1..8d23df10c0 100644 --- a/include/llvm/DerivedTypes.h +++ b/include/llvm/DerivedTypes.h @@ -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 diff --git a/include/llvm/ExecutionEngine/ExecutionEngine.h b/include/llvm/ExecutionEngine/ExecutionEngine.h index c2a0a3a7d2..5dd74b7cde 100644 --- a/include/llvm/ExecutionEngine/ExecutionEngine.h +++ b/include/llvm/ExecutionEngine/ExecutionEngine.h @@ -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 diff --git a/include/llvm/ExecutionEngine/GenericValue.h b/include/llvm/ExecutionEngine/GenericValue.h index b64eb79bbd..0446795d31 100644 --- a/include/llvm/ExecutionEngine/GenericValue.h +++ b/include/llvm/ExecutionEngine/GenericValue.h @@ -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 diff --git a/include/llvm/Function.h b/include/llvm/Function.h index 3c44b3658f..4dd791ec21 100644 --- a/include/llvm/Function.h +++ b/include/llvm/Function.h @@ -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 diff --git a/include/llvm/GlobalValue.h b/include/llvm/GlobalValue.h index f2349bc3cb..47a2189fa4 100644 --- a/include/llvm/GlobalValue.h +++ b/include/llvm/GlobalValue.h @@ -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 diff --git a/include/llvm/GlobalVariable.h b/include/llvm/GlobalVariable.h index d1a9a293c6..03c4f39120 100644 --- a/include/llvm/GlobalVariable.h +++ b/include/llvm/GlobalVariable.h @@ -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 diff --git a/include/llvm/InstrTypes.h b/include/llvm/InstrTypes.h index e3d3d61adb..7938b483c7 100644 --- a/include/llvm/InstrTypes.h +++ b/include/llvm/InstrTypes.h @@ -18,6 +18,8 @@ #include "llvm/Instruction.h" +namespace llvm { + //===----------------------------------------------------------------------===// // TerminatorInst Class //===----------------------------------------------------------------------===// @@ -134,4 +136,6 @@ public: } }; +} // End llvm namespace + #endif diff --git a/include/llvm/Instruction.def b/include/llvm/Instruction.def index e069e2ca7a..4208642d7f 100644 --- a/include/llvm/Instruction.def +++ b/include/llvm/Instruction.def @@ -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 diff --git a/include/llvm/Instruction.h b/include/llvm/Instruction.h index 264356ca91..cc9a8aec2b 100644 --- a/include/llvm/Instruction.h +++ b/include/llvm/Instruction.h @@ -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 diff --git a/include/llvm/Intrinsics.h b/include/llvm/Intrinsics.h index 9d7c7bc994..8ecb6c42ee 100644 --- a/include/llvm/Intrinsics.h +++ b/include/llvm/Intrinsics.h @@ -16,11 +16,13 @@ #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 diff --git a/include/llvm/Linker.h b/include/llvm/Linker.h index ac399034d4..9f4c8c25f6 100644 --- a/include/llvm/Linker.h +++ b/include/llvm/Linker.h @@ -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 diff --git a/include/llvm/Module.h b/include/llvm/Module.h index 19626aea03..b38269dde0 100644 --- a/include/llvm/Module.h +++ b/include/llvm/Module.h @@ -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 diff --git a/include/llvm/ModuleProvider.h b/include/llvm/ModuleProvider.h index 8d4b1d23af..de9616fe2e 100644 --- a/include/llvm/ModuleProvider.h +++ b/include/llvm/ModuleProvider.h @@ -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 diff --git a/include/llvm/Pass.h b/include/llvm/Pass.h index 0d0a6e6fbc..8a10ead35e 100644 --- a/include/llvm/Pass.h +++ b/include/llvm/Pass.h @@ -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. // diff --git a/include/llvm/PassAnalysisSupport.h b/include/llvm/PassAnalysisSupport.h index 61fb29fb81..f62465a8b8 100644 --- a/include/llvm/PassAnalysisSupport.h +++ b/include/llvm/PassAnalysisSupport.h @@ -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 diff --git a/include/llvm/PassManager.h b/include/llvm/PassManager.h index c47abdaef9..b1d369b925 100644 --- a/include/llvm/PassManager.h +++ b/include/llvm/PassManager.h @@ -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 diff --git a/include/llvm/PassSupport.h b/include/llvm/PassSupport.h index 226ee29357..d985bf121d 100644 --- a/include/llvm/PassSupport.h +++ b/include/llvm/PassSupport.h @@ -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 diff --git a/include/llvm/SlotCalculator.h b/include/llvm/SlotCalculator.h index 7e56de99dc..596f9324ed 100644 --- a/include/llvm/SlotCalculator.h +++ b/include/llvm/SlotCalculator.h @@ -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 diff --git a/include/llvm/Support/Annotation.h b/include/llvm/Support/Annotation.h index 075ffc297a..cee7ab7d89 100644 --- a/include/llvm/Support/Annotation.h +++ b/include/llvm/Support/Annotation.h @@ -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 diff --git a/include/llvm/Support/CFG.h b/include/llvm/Support/CFG.h index 26616dbb7a..bbe1701da1 100644 --- a/include/llvm/Support/CFG.h +++ b/include/llvm/Support/CFG.h @@ -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 diff --git a/include/llvm/Support/CallSite.h b/include/llvm/Support/CallSite.h index 5e3fd3e662..8f7cf1a786 100644 --- a/include/llvm/Support/CallSite.h +++ b/include/llvm/Support/CallSite.h @@ -23,6 +23,8 @@ #include "llvm/Instruction.h" +namespace llvm { + class CallInst; class InvokeInst; @@ -100,4 +102,6 @@ public: } }; +} // End llvm namespace + #endif diff --git a/include/llvm/Support/Casting.h b/include/llvm/Support/Casting.h index 065919c179..4b070c18d8 100644 --- a/include/llvm/Support/Casting.h +++ b/include/llvm/Support/Casting.h @@ -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 diff --git a/include/llvm/Support/CommandLine.h b/include/llvm/Support/CommandLine.h index 01f55a81d4..df40d80070 100644 --- a/include/llvm/Support/CommandLine.h +++ b/include/llvm/Support/CommandLine.h @@ -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 diff --git a/include/llvm/Support/ConstantRange.h b/include/llvm/Support/ConstantRange.h index c173549a37..d97b73e824 100644 --- a/include/llvm/Support/ConstantRange.h +++ b/include/llvm/Support/ConstantRange.h @@ -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 diff --git a/include/llvm/Support/DOTGraphTraits.h b/include/llvm/Support/DOTGraphTraits.h index 002a78ec4f..63837b7ddf 100644 --- a/include/llvm/Support/DOTGraphTraits.h +++ b/include/llvm/Support/DOTGraphTraits.h @@ -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 diff --git a/include/llvm/Support/Debug.h b/include/llvm/Support/Debug.h index 8cba05771f..66a208811a 100644 --- a/include/llvm/Support/Debug.h +++ b/include/llvm/Support/Debug.h @@ -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 diff --git a/include/llvm/Support/DynamicLinker.h b/include/llvm/Support/DynamicLinker.h index 8f02708268..fec9a45296 100644 --- a/include/llvm/Support/DynamicLinker.h +++ b/include/llvm/Support/DynamicLinker.h @@ -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 diff --git a/include/llvm/Support/FileUtilities.h b/include/llvm/Support/FileUtilities.h index 0dfa625362..c276ec7aaa 100644 --- a/include/llvm/Support/FileUtilities.h +++ b/include/llvm/Support/FileUtilities.h @@ -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 diff --git a/include/llvm/Support/GraphWriter.h b/include/llvm/Support/GraphWriter.h index 2cb8fcc985..7e5aa80645 100644 --- a/include/llvm/Support/GraphWriter.h +++ b/include/llvm/Support/GraphWriter.h @@ -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 diff --git a/include/llvm/Support/InstIterator.h b/include/llvm/Support/InstIterator.h index 4c2d185576..31c8b660d6 100644 --- a/include/llvm/Support/InstIterator.h +++ b/include/llvm/Support/InstIterator.h @@ -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 diff --git a/include/llvm/Support/InstVisitor.h b/include/llvm/Support/InstVisitor.h index de1bce96bb..9a34edb71f 100644 --- a/include/llvm/Support/InstVisitor.h +++ b/include/llvm/Support/InstVisitor.h @@ -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 diff --git a/include/llvm/Support/LeakDetector.h b/include/llvm/Support/LeakDetector.h index b39e0b5911..e2ce9c50be 100644 --- a/include/llvm/Support/LeakDetector.h +++ b/include/llvm/Support/LeakDetector.h @@ -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 diff --git a/include/llvm/Support/Linker.h b/include/llvm/Support/Linker.h index ac399034d4..9f4c8c25f6 100644 --- a/include/llvm/Support/Linker.h +++ b/include/llvm/Support/Linker.h @@ -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 diff --git a/include/llvm/Support/MallocAllocator.h b/include/llvm/Support/MallocAllocator.h index 1ba25b0d65..766a67fa22 100644 --- a/include/llvm/Support/MallocAllocator.h +++ b/include/llvm/Support/MallocAllocator.h @@ -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 diff --git a/include/llvm/Support/Mangler.h b/include/llvm/Support/Mangler.h index 1f56ff319e..5b312f8ef4 100644 --- a/include/llvm/Support/Mangler.h +++ b/include/llvm/Support/Mangler.h @@ -14,12 +14,19 @@ #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 diff --git a/include/llvm/Support/MathExtras.h b/include/llvm/Support/MathExtras.h index ec742324b0..74958fbc35 100644 --- a/include/llvm/Support/MathExtras.h +++ b/include/llvm/Support/MathExtras.h @@ -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 diff --git a/include/llvm/Support/PassNameParser.h b/include/llvm/Support/PassNameParser.h index f63666ba66..0ffcabad52 100644 --- a/include/llvm/Support/PassNameParser.h +++ b/include/llvm/Support/PassNameParser.h @@ -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 diff --git a/include/llvm/Support/SystemUtils.h b/include/llvm/Support/SystemUtils.h index ccde86cce6..c874d9932c 100644 --- a/include/llvm/Support/SystemUtils.h +++ b/include/llvm/Support/SystemUtils.h @@ -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 diff --git a/include/llvm/Support/Timer.h b/include/llvm/Support/Timer.h index 57ef3f0d64..ac465bb95b 100644 --- a/include/llvm/Support/Timer.h +++ b/include/llvm/Support/Timer.h @@ -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 diff --git a/include/llvm/Support/ToolRunner.h b/include/llvm/Support/ToolRunner.h index e23ec7f312..8ce3f5d8f3 100644 --- a/include/llvm/Support/ToolRunner.h +++ b/include/llvm/Support/ToolRunner.h @@ -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 diff --git a/include/llvm/Support/TypeInfo.h b/include/llvm/Support/TypeInfo.h index aa2093a43d..5d9035076f 100644 --- a/include/llvm/Support/TypeInfo.h +++ b/include/llvm/Support/TypeInfo.h @@ -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 diff --git a/include/llvm/Support/ValueHolder.h b/include/llvm/Support/ValueHolder.h index 62ab9d9ca2..bab201287e 100644 --- a/include/llvm/Support/ValueHolder.h +++ b/include/llvm/Support/ValueHolder.h @@ -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 diff --git a/include/llvm/SymbolTable.h b/include/llvm/SymbolTable.h index 42f15aa626..8502375581 100644 --- a/include/llvm/SymbolTable.h +++ b/include/llvm/SymbolTable.h @@ -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 diff --git a/include/llvm/SymbolTableListTraits.h b/include/llvm/SymbolTableListTraits.h index 820f391d40..46be356151 100644 --- a/include/llvm/SymbolTableListTraits.h +++ b/include/llvm/SymbolTableListTraits.h @@ -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 diff --git a/include/llvm/System/Signals.h b/include/llvm/System/Signals.h index ce12301a15..0cbf398798 100644 --- a/include/llvm/System/Signals.h +++ b/include/llvm/System/Signals.h @@ -17,10 +17,13 @@ #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 diff --git a/include/llvm/Target/MRegisterInfo.h b/include/llvm/Target/MRegisterInfo.h index a87c74fc4e..3217b47b72 100644 --- a/include/llvm/Target/MRegisterInfo.h +++ b/include/llvm/Target/MRegisterInfo.h @@ -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 diff --git a/include/llvm/Target/TargetCacheInfo.h b/include/llvm/Target/TargetCacheInfo.h index 56f20bf524..357adf0685 100644 --- a/include/llvm/Target/TargetCacheInfo.h +++ b/include/llvm/Target/TargetCacheInfo.h @@ -16,6 +16,8 @@ #include "Support/DataTypes.h" +namespace llvm { + class TargetMachine; struct TargetCacheInfo { @@ -59,4 +61,6 @@ public: } }; +} // End llvm namespace + #endif diff --git a/include/llvm/Target/TargetData.h b/include/llvm/Target/TargetData.h index 8dcb6255d4..9be9564f16 100644 --- a/include/llvm/Target/TargetData.h +++ b/include/llvm/Target/TargetData.h @@ -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 diff --git a/include/llvm/Target/TargetFrameInfo.h b/include/llvm/Target/TargetFrameInfo.h index 0f82e27470..2b968fab1a 100644 --- a/include/llvm/Target/TargetFrameInfo.h +++ b/include/llvm/Target/TargetFrameInfo.h @@ -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 diff --git a/include/llvm/Target/TargetInstrInfo.h b/include/llvm/Target/TargetInstrInfo.h index 76cfb392ae..c6afba5a15 100644 --- a/include/llvm/Target/TargetInstrInfo.h +++ b/include/llvm/Target/TargetInstrInfo.h @@ -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 diff --git a/include/llvm/Target/TargetMachine.h b/include/llvm/Target/TargetMachine.h index af06349aa9..c0771a1746 100644 --- a/include/llvm/Target/TargetMachine.h +++ b/include/llvm/Target/TargetMachine.h @@ -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 diff --git a/include/llvm/Target/TargetMachineImpls.h b/include/llvm/Target/TargetMachineImpls.h index 670b2dc4b6..3ca20c74e9 100644 --- a/include/llvm/Target/TargetMachineImpls.h +++ b/include/llvm/Target/TargetMachineImpls.h @@ -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 diff --git a/include/llvm/Target/TargetRegInfo.h b/include/llvm/Target/TargetRegInfo.h index 36bfc0b915..f9f67c7424 100644 --- a/include/llvm/Target/TargetRegInfo.h +++ b/include/llvm/Target/TargetRegInfo.h @@ -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 diff --git a/include/llvm/Target/TargetSchedInfo.h b/include/llvm/Target/TargetSchedInfo.h index dd8df32044..ae97d109e3 100644 --- a/include/llvm/Target/TargetSchedInfo.h +++ b/include/llvm/Target/TargetSchedInfo.h @@ -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 diff --git a/include/llvm/Transforms/IPO.h b/include/llvm/Transforms/IPO.h index 62ed93c5bb..80f5a527ab 100644 --- a/include/llvm/Transforms/IPO.h +++ b/include/llvm/Transforms/IPO.h @@ -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 diff --git a/include/llvm/Transforms/Instrumentation.h b/include/llvm/Transforms/Instrumentation.h index abe4fc46f6..035b8d1e0c 100644 --- a/include/llvm/Transforms/Instrumentation.h +++ b/include/llvm/Transforms/Instrumentation.h @@ -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 diff --git a/include/llvm/Transforms/MutateStructTypes.h b/include/llvm/Transforms/MutateStructTypes.h index f9b753caf4..c68f2ddf27 100644 --- a/include/llvm/Transforms/MutateStructTypes.h +++ b/include/llvm/Transforms/MutateStructTypes.h @@ -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 diff --git a/include/llvm/Transforms/Scalar.h b/include/llvm/Transforms/Scalar.h index 81fd59767d..da17b8d10c 100644 --- a/include/llvm/Transforms/Scalar.h +++ b/include/llvm/Transforms/Scalar.h @@ -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 diff --git a/include/llvm/Transforms/Utils/BasicBlockUtils.h b/include/llvm/Transforms/Utils/BasicBlockUtils.h index 4630d5399a..155eae8e36 100644 --- a/include/llvm/Transforms/Utils/BasicBlockUtils.h +++ b/include/llvm/Transforms/Utils/BasicBlockUtils.h @@ -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 diff --git a/include/llvm/Transforms/Utils/Cloning.h b/include/llvm/Transforms/Utils/Cloning.h index 351deefa8c..f6351d4876 100644 --- a/include/llvm/Transforms/Utils/Cloning.h +++ b/include/llvm/Transforms/Utils/Cloning.h @@ -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 diff --git a/include/llvm/Transforms/Utils/DemoteRegToStack.h b/include/llvm/Transforms/Utils/DemoteRegToStack.h index 1d6d2c6595..5810087f82 100644 --- a/include/llvm/Transforms/Utils/DemoteRegToStack.h +++ b/include/llvm/Transforms/Utils/DemoteRegToStack.h @@ -24,7 +24,11 @@ // //===----------------------------------------------------------------------===// +namespace llvm { + class Instruction; class AllocaInst; AllocaInst *DemoteRegToStack(Instruction &X); + +} // End llvm namespace diff --git a/include/llvm/Transforms/Utils/Linker.h b/include/llvm/Transforms/Utils/Linker.h index ac399034d4..9f4c8c25f6 100644 --- a/include/llvm/Transforms/Utils/Linker.h +++ b/include/llvm/Transforms/Utils/Linker.h @@ -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 diff --git a/include/llvm/Transforms/Utils/Local.h b/include/llvm/Transforms/Utils/Local.h index 286aef993e..2f83174249 100644 --- a/include/llvm/Transforms/Utils/Local.h +++ b/include/llvm/Transforms/Utils/Local.h @@ -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 diff --git a/include/llvm/Transforms/Utils/PromoteMemToReg.h b/include/llvm/Transforms/Utils/PromoteMemToReg.h index 57d5dae43c..38ea373885 100644 --- a/include/llvm/Transforms/Utils/PromoteMemToReg.h +++ b/include/llvm/Transforms/Utils/PromoteMemToReg.h @@ -15,11 +15,14 @@ #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 diff --git a/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h b/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h index a59517c689..590d51034b 100644 --- a/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h +++ b/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h @@ -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 diff --git a/include/llvm/Type.def b/include/llvm/Type.def index 566a9a3f02..6101cd0aa0 100644 --- a/include/llvm/Type.def +++ b/include/llvm/Type.def @@ -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) diff --git a/include/llvm/Type.h b/include/llvm/Type.h index 4c9fd1db48..ba4ac3415f 100644 --- a/include/llvm/Type.h +++ b/include/llvm/Type.h @@ -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 diff --git a/include/llvm/Use.h b/include/llvm/Use.h index 4deee300f6..f94045b39e 100644 --- a/include/llvm/Use.h +++ b/include/llvm/Use.h @@ -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 diff --git a/include/llvm/User.h b/include/llvm/User.h index aba56d5819..cdd9b539ca 100644 --- a/include/llvm/User.h +++ b/include/llvm/User.h @@ -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 diff --git a/include/llvm/Value.h b/include/llvm/Value.h index 537bcba11b..e92d6fc6cb 100644 --- a/include/llvm/Value.h +++ b/include/llvm/Value.h @@ -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 diff --git a/include/llvm/iMemory.h b/include/llvm/iMemory.h index db82b54c01..e0a551a0f7 100644 --- a/include/llvm/iMemory.h +++ b/include/llvm/iMemory.h @@ -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 diff --git a/include/llvm/iOperators.h b/include/llvm/iOperators.h index 39bfe14660..ecf99172a1 100644 --- a/include/llvm/iOperators.h +++ b/include/llvm/iOperators.h @@ -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 diff --git a/include/llvm/iOther.h b/include/llvm/iOther.h index 4e23afdc89..c611e06612 100644 --- a/include/llvm/iOther.h +++ b/include/llvm/iOther.h @@ -17,6 +17,8 @@ #include "llvm/InstrTypes.h" +namespace llvm { + //===----------------------------------------------------------------------===// // CastInst Class //===----------------------------------------------------------------------===// @@ -195,4 +197,6 @@ public: } }; +} // End llvm namespace + #endif diff --git a/include/llvm/iPHINode.h b/include/llvm/iPHINode.h index 54b867d59d..191de040e7 100644 --- a/include/llvm/iPHINode.h +++ b/include/llvm/iPHINode.h @@ -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 diff --git a/include/llvm/iTerminators.h b/include/llvm/iTerminators.h index 5f435a05c6..93e3adce76 100644 --- a/include/llvm/iTerminators.h +++ b/include/llvm/iTerminators.h @@ -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 |