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 /lib/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 'lib/Support')
-rw-r--r-- | lib/Support/Annotation.cpp | 4 | ||||
-rw-r--r-- | lib/Support/CommandLine.cpp | 4 | ||||
-rw-r--r-- | lib/Support/ConstantRange.cpp | 4 | ||||
-rw-r--r-- | lib/Support/Debug.cpp | 4 | ||||
-rw-r--r-- | lib/Support/DynamicLinker.cpp | 4 | ||||
-rw-r--r-- | lib/Support/FileUtilities.cpp | 5 | ||||
-rw-r--r-- | lib/Support/LeakDetector.cpp | 4 | ||||
-rw-r--r-- | lib/Support/Mangler.cpp | 3 | ||||
-rw-r--r-- | lib/Support/PluginLoader.cpp | 4 | ||||
-rw-r--r-- | lib/Support/Signals.cpp | 4 | ||||
-rw-r--r-- | lib/Support/Statistic.cpp | 6 | ||||
-rw-r--r-- | lib/Support/SystemUtils.cpp | 3 | ||||
-rw-r--r-- | lib/Support/Timer.cpp | 7 | ||||
-rw-r--r-- | lib/Support/ToolRunner.cpp | 4 | ||||
-rw-r--r-- | lib/Support/ValueHolder.cpp | 4 |
15 files changed, 62 insertions, 2 deletions
diff --git a/lib/Support/Annotation.cpp b/lib/Support/Annotation.cpp index 890b18de06..b88624dd1f 100644 --- a/lib/Support/Annotation.cpp +++ b/lib/Support/Annotation.cpp @@ -14,6 +14,8 @@ #include <map> #include "Support/Annotation.h" +namespace llvm { + typedef std::map<const std::string, unsigned> IDMapType; static unsigned IDCounter = 0; // Unique ID counter @@ -94,3 +96,5 @@ Annotation *AnnotationManager::createAnnotation(AnnotationID ID, if (I == getFactMap().end()) return 0; return I->second.first(ID, Obj, I->second.second); } + +} // End llvm namespace diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp index de895c9117..235dc12843 100644 --- a/lib/Support/CommandLine.cpp +++ b/lib/Support/CommandLine.cpp @@ -24,6 +24,8 @@ #include <cstdlib> #include <cerrno> +namespace llvm { + using namespace cl; //===----------------------------------------------------------------------===// @@ -887,3 +889,5 @@ HHOp("help-hidden", cl::desc("display all available options"), cl::location(HiddenPrinter), cl::Hidden, cl::ValueDisallowed); } // End anonymous namespace + +} // End llvm namespace diff --git a/lib/Support/ConstantRange.cpp b/lib/Support/ConstantRange.cpp index a9e1204de5..e180f12a1a 100644 --- a/lib/Support/ConstantRange.cpp +++ b/lib/Support/ConstantRange.cpp @@ -26,6 +26,8 @@ #include "llvm/Instruction.h" #include "llvm/ConstantHandling.h" +namespace llvm { + /// Initialize a full (the default) or empty set for the specified type. /// ConstantRange::ConstantRange(const Type *Ty, bool Full) { @@ -248,3 +250,5 @@ void ConstantRange::print(std::ostream &OS) const { void ConstantRange::dump() const { print(std::cerr); } + +} // End llvm namespace diff --git a/lib/Support/Debug.cpp b/lib/Support/Debug.cpp index 895abbb1f7..1af23380a2 100644 --- a/lib/Support/Debug.cpp +++ b/lib/Support/Debug.cpp @@ -26,6 +26,8 @@ #include "Support/Statistic.h" #include "Support/CommandLine.h" +namespace llvm { + bool DebugFlag; // DebugFlag - Exported boolean set by the -debug option namespace { @@ -62,3 +64,5 @@ bool isCurrentDebugType(const char *DebugType) { return false; #endif } + +} // End llvm namespace diff --git a/lib/Support/DynamicLinker.cpp b/lib/Support/DynamicLinker.cpp index 74b3603679..1c9385eea7 100644 --- a/lib/Support/DynamicLinker.cpp +++ b/lib/Support/DynamicLinker.cpp @@ -23,6 +23,8 @@ #include "Config/dlfcn.h" #include <cassert> +namespace llvm { + bool LinkDynamicObject (const char *filename, std::string *ErrorMessage) { #if defined (HAVE_DLOPEN) if (dlopen (filename, RTLD_NOW | RTLD_GLOBAL) == 0) { @@ -52,3 +54,5 @@ void *GetAddressOfSymbol (const char *symbolName) { void *GetAddressOfSymbol (const std::string &symbolName) { return GetAddressOfSymbol (symbolName.c_str ()); } + +} // End llvm namespace diff --git a/lib/Support/FileUtilities.cpp b/lib/Support/FileUtilities.cpp index 3262ecce31..cde288925b 100644 --- a/lib/Support/FileUtilities.cpp +++ b/lib/Support/FileUtilities.cpp @@ -20,6 +20,9 @@ #include <iostream> #include <cstdio> +namespace llvm +{ + /// CheckMagic - Returns true IFF the file named FN begins with Magic. FN must /// name a readable file. /// @@ -182,3 +185,5 @@ bool MakeFileExecutable (const std::string &Filename) { bool MakeFileReadable (const std::string &Filename) { return AddPermissionsBits (Filename, 0444); } + +} // End llvm namespace diff --git a/lib/Support/LeakDetector.cpp b/lib/Support/LeakDetector.cpp index 24c946ab6e..ffb081a998 100644 --- a/lib/Support/LeakDetector.cpp +++ b/lib/Support/LeakDetector.cpp @@ -15,6 +15,8 @@ #include "llvm/Value.h" #include <set> +namespace llvm { + // Lazily allocate set so that release build doesn't have to do anything. static std::set<const void*> *Objects = 0; static std::set<const Value*> *LLVMObjects = 0; @@ -87,3 +89,5 @@ void LeakDetector::checkForGarbageImpl(const std::string &Message) { Objects = 0; LLVMObjects = 0; } } + +} // End llvm namespace diff --git a/lib/Support/Mangler.cpp b/lib/Support/Mangler.cpp index 44c697d3d8..567fe05e32 100644 --- a/lib/Support/Mangler.cpp +++ b/lib/Support/Mangler.cpp @@ -16,6 +16,8 @@ #include "llvm/Type.h" #include "Support/StringExtras.h" +namespace llvm { + static char HexDigit(int V) { return V < 10 ? V+'0' : V+'A'-10; } @@ -99,3 +101,4 @@ Mangler::Mangler(Module &m, bool addUnderscorePrefix) FoundNames.insert(I->getName()); // Otherwise, keep track of name } +} // End llvm namespace diff --git a/lib/Support/PluginLoader.cpp b/lib/Support/PluginLoader.cpp index 1582a10c65..1729bb3365 100644 --- a/lib/Support/PluginLoader.cpp +++ b/lib/Support/PluginLoader.cpp @@ -23,6 +23,8 @@ #include "Config/link.h" #include <iostream> +namespace llvm { + namespace { struct PluginLoader { void operator=(const std::string &Filename) { @@ -38,3 +40,5 @@ namespace { static cl::opt<PluginLoader, false, cl::parser<std::string> > LoadOpt("load", cl::ZeroOrMore, cl::value_desc("plugin.so"), cl::desc("Load the specified plugin")); + +} // End llvm namespace diff --git a/lib/Support/Signals.cpp b/lib/Support/Signals.cpp index efc5f71257..73decfd89b 100644 --- a/lib/Support/Signals.cpp +++ b/lib/Support/Signals.cpp @@ -20,6 +20,8 @@ #include <signal.h> #include "Config/config.h" // Get the signal handler return type +namespace llvm { + static std::vector<std::string> FilesToRemove; // IntSigs - Signals that may interrupt the program at any time. @@ -62,3 +64,5 @@ void RemoveFileOnSignal(const std::string &Filename) { std::for_each(IntSigs, IntSigsEnd, RegisterHandler); std::for_each(KillSigs, KillSigsEnd, RegisterHandler); } + +} // End llvm namespace diff --git a/lib/Support/Statistic.cpp b/lib/Support/Statistic.cpp index c60a85cdeb..3ac2bf97fb 100644 --- a/lib/Support/Statistic.cpp +++ b/lib/Support/Statistic.cpp @@ -27,8 +27,10 @@ #include <iostream> #include <algorithm> +namespace llvm { + // GetLibSupportInfoOutputFile - Return a file stream to print our output on... -std::ostream *GetLibSupportInfoOutputFile(); +extern std::ostream *GetLibSupportInfoOutputFile(); unsigned StatisticBase::NumStats = 0; @@ -104,3 +106,5 @@ void StatisticBase::destroy() const { delete OutStream; // Close the file... } } + +} // End llvm namespace diff --git a/lib/Support/SystemUtils.cpp b/lib/Support/SystemUtils.cpp index 8c009ffb57..ec535ad45a 100644 --- a/lib/Support/SystemUtils.cpp +++ b/lib/Support/SystemUtils.cpp @@ -24,6 +24,8 @@ #include "Config/unistd.h" #include "Config/errno.h" +namespace llvm { + /// isExecutableFile - This function returns true if the filename specified /// exists and is executable. /// @@ -272,3 +274,4 @@ ExecWait (const char * const old_argv[], const char * const old_envp[]) return 1; } +} // End llvm namespace diff --git a/lib/Support/Timer.cpp b/lib/Support/Timer.cpp index 5e84f38852..d14a225fcf 100644 --- a/lib/Support/Timer.cpp +++ b/lib/Support/Timer.cpp @@ -23,6 +23,8 @@ #include <fstream> #include <map> +namespace llvm { + // getLibSupportInfoOutputFilename - This ugly hack is brought to you courtesy // of constructor/destructor ordering being unspecified by C++. Basically the // problem is that a Statistic<> object gets destroyed, which ends up calling @@ -265,7 +267,8 @@ void Timer::print(const Timer &Total, std::ostream &OS) { } // GetLibSupportInfoOutputFile - Return a file stream to print our output on... -std::ostream *GetLibSupportInfoOutputFile() { +std::ostream * +GetLibSupportInfoOutputFile() { std::string &LibSupportInfoOutputFilename = getLibSupportInfoOutputFilename(); if (LibSupportInfoOutputFilename.empty()) return &std::cerr; @@ -349,3 +352,5 @@ void TimerGroup::removeTimer() { DefaultTimerGroup = 0; } } + +} // End llvm namespace diff --git a/lib/Support/ToolRunner.cpp b/lib/Support/ToolRunner.cpp index a66b868c22..50a9ad21c8 100644 --- a/lib/Support/ToolRunner.cpp +++ b/lib/Support/ToolRunner.cpp @@ -18,6 +18,8 @@ #include <iostream> #include <fstream> +namespace llvm { + //===---------------------------------------------------------------------===// // LLI Implementation of AbstractIntepreter interface // @@ -391,3 +393,5 @@ GCC *GCC::create(const std::string &ProgramPath, std::string &Message) { Message = "Found gcc: " + GCCPath + "\n"; return new GCC(GCCPath); } + +} // End llvm namespace diff --git a/lib/Support/ValueHolder.cpp b/lib/Support/ValueHolder.cpp index 8661402b06..77fdaf6b44 100644 --- a/lib/Support/ValueHolder.cpp +++ b/lib/Support/ValueHolder.cpp @@ -18,6 +18,10 @@ #include "llvm/Support/ValueHolder.h" #include "llvm/Type.h" +namespace llvm { + ValueHolder::ValueHolder(Value *V) : User(Type::TypeTy, Value::TypeVal) { Operands.push_back(Use(V, this)); } + +} // End llvm namespace |