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/Support | |
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/Support')
28 files changed, 110 insertions, 2 deletions
diff --git a/include/Support/Annotation.h b/include/Support/Annotation.h index 075ffc297a..cee7ab7d89 100644 --- a/include/Support/Annotation.h +++ b/include/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/Support/BitSetVector.h b/include/Support/BitSetVector.h index 08bafa1580..72f55b38c4 100644 --- a/include/Support/BitSetVector.h +++ b/include/Support/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/Support/Casting.h b/include/Support/Casting.h index 065919c179..4b070c18d8 100644 --- a/include/Support/Casting.h +++ b/include/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/Support/CommandLine.h b/include/Support/CommandLine.h index 01f55a81d4..df40d80070 100644 --- a/include/Support/CommandLine.h +++ b/include/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/Support/DOTGraphTraits.h b/include/Support/DOTGraphTraits.h index 002a78ec4f..63837b7ddf 100644 --- a/include/Support/DOTGraphTraits.h +++ b/include/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/Support/Debug.h b/include/Support/Debug.h index 8cba05771f..66a208811a 100644 --- a/include/Support/Debug.h +++ b/include/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/Support/DepthFirstIterator.h b/include/Support/DepthFirstIterator.h index bb7673c83d..c465f4e549 100644 --- a/include/Support/DepthFirstIterator.h +++ b/include/Support/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/Support/DynamicLinker.h b/include/Support/DynamicLinker.h index 8f02708268..fec9a45296 100644 --- a/include/Support/DynamicLinker.h +++ b/include/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/Support/EquivalenceClasses.h b/include/Support/EquivalenceClasses.h index 01e8c5ef82..46e626b69b 100644 --- a/include/Support/EquivalenceClasses.h +++ b/include/Support/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/Support/FileUtilities.h b/include/Support/FileUtilities.h index 0dfa625362..c276ec7aaa 100644 --- a/include/Support/FileUtilities.h +++ b/include/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/Support/GraphTraits.h b/include/Support/GraphTraits.h index 305f71e280..4ff74176a7 100644 --- a/include/Support/GraphTraits.h +++ b/include/Support/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/Support/GraphWriter.h b/include/Support/GraphWriter.h index 2cb8fcc985..7e5aa80645 100644 --- a/include/Support/GraphWriter.h +++ b/include/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/Support/LeakDetector.h b/include/Support/LeakDetector.h index b39e0b5911..e2ce9c50be 100644 --- a/include/Support/LeakDetector.h +++ b/include/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/Support/MallocAllocator.h b/include/Support/MallocAllocator.h index 1ba25b0d65..766a67fa22 100644 --- a/include/Support/MallocAllocator.h +++ b/include/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/Support/MathExtras.h b/include/Support/MathExtras.h index ec742324b0..74958fbc35 100644 --- a/include/Support/MathExtras.h +++ b/include/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/Support/PostOrderIterator.h b/include/Support/PostOrderIterator.h index 9309554f32..d66c4b84c4 100644 --- a/include/Support/PostOrderIterator.h +++ b/include/Support/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/Support/SCCIterator.h b/include/Support/SCCIterator.h index cf137cd473..f21c7d162e 100644 --- a/include/Support/SCCIterator.h +++ b/include/Support/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/Support/STLExtras.h b/include/Support/STLExtras.h index 28c46e3d99..06a15734a7 100644 --- a/include/Support/STLExtras.h +++ b/include/Support/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/Support/SetOperations.h b/include/Support/SetOperations.h index dc6e0d6029..bb1e68e6b2 100644 --- a/include/Support/SetOperations.h +++ b/include/Support/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/Support/Signals.h b/include/Support/Signals.h index ce12301a15..0cbf398798 100644 --- a/include/Support/Signals.h +++ b/include/Support/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/Support/Statistic.h b/include/Support/Statistic.h index d69809ff18..4e592d5832 100644 --- a/include/Support/Statistic.h +++ b/include/Support/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/Support/StringExtras.h b/include/Support/StringExtras.h index 2c50c1cd5b..2ebac81935 100644 --- a/include/Support/StringExtras.h +++ b/include/Support/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/Support/SystemUtils.h b/include/Support/SystemUtils.h index ccde86cce6..c874d9932c 100644 --- a/include/Support/SystemUtils.h +++ b/include/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/Support/Timer.h b/include/Support/Timer.h index 57ef3f0d64..ac465bb95b 100644 --- a/include/Support/Timer.h +++ b/include/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/Support/Tree.h b/include/Support/Tree.h index e6454317a8..bc5495f25a 100644 --- a/include/Support/Tree.h +++ b/include/Support/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/Support/TypeInfo.h b/include/Support/TypeInfo.h index aa2093a43d..5d9035076f 100644 --- a/include/Support/TypeInfo.h +++ b/include/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/Support/VectorExtras.h b/include/Support/VectorExtras.h index 32778309d4..cf7cf5d2eb 100644 --- a/include/Support/VectorExtras.h +++ b/include/Support/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/Support/ilist b/include/Support/ilist index 488a90ffde..7f4d2659d5 100644 --- a/include/Support/ilist +++ b/include/Support/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... |