summaryrefslogtreecommitdiff
path: root/include/llvm/System
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/System')
-rw-r--r--include/llvm/System/Memory.h1
-rw-r--r--include/llvm/System/Path.h5
-rw-r--r--include/llvm/System/Process.h2
-rw-r--r--include/llvm/System/Program.h3
-rw-r--r--include/llvm/System/Signals.h4
-rw-r--r--include/llvm/System/ThreadLocal.h13
6 files changed, 20 insertions, 8 deletions
diff --git a/include/llvm/System/Memory.h b/include/llvm/System/Memory.h
index 01bcab1f0070c..2dd36e8ab1479 100644
--- a/include/llvm/System/Memory.h
+++ b/include/llvm/System/Memory.h
@@ -63,7 +63,6 @@ namespace sys {
///
/// On success, this returns false, otherwise it returns true and fills
/// in *ErrMsg.
- /// @throws std::string if an error occurred.
/// @brief Release Read/Write/Execute memory.
static bool ReleaseRWX(MemoryBlock &block, std::string *ErrMsg = 0);
diff --git a/include/llvm/System/Path.h b/include/llvm/System/Path.h
index 0461769f97108..23b18d47145aa 100644
--- a/include/llvm/System/Path.h
+++ b/include/llvm/System/Path.h
@@ -164,6 +164,7 @@ namespace sys {
/// GetMainExecutable - Return the path to the main executable, given the
/// value of argv[0] from program startup and the address of main itself.
+ /// In extremis, this function may fail and return an empty path.
static Path GetMainExecutable(const char *argv0, void *MainAddr);
/// This is one of the very few ways in which a path can be constructed
@@ -336,9 +337,9 @@ namespace sys {
/// native Dynamic Library (shared library, shared object) by looking at
/// the file's magic number. The Path object must reference a file, not a
/// directory.
- /// @return strue if the file starts with the magid number for a native
+ /// @returns true if the file starts with the magic number for a native
/// shared library.
- /// @brief Determine if the path reference a dynamic library.
+ /// @brief Determine if the path references a dynamic library.
bool isDynamicLibrary() const;
/// This function determines if the path name references an existing file
diff --git a/include/llvm/System/Process.h b/include/llvm/System/Process.h
index 010499acd4bfe..41bcd69b6a44c 100644
--- a/include/llvm/System/Process.h
+++ b/include/llvm/System/Process.h
@@ -30,7 +30,6 @@ namespace sys {
/// This static function will return the operating system's virtual memory
/// page size.
/// @returns The number of bytes in a virtual memory page.
- /// @throws nothing
/// @brief Get the virtual memory page size
static unsigned GetPageSize();
@@ -38,7 +37,6 @@ namespace sys {
/// by the process. This only counts the memory allocated via the malloc,
/// calloc and realloc functions and includes any "free" holes in the
/// allocated space.
- /// @throws nothing
/// @brief Return process memory usage.
static size_t GetMallocUsage();
diff --git a/include/llvm/System/Program.h b/include/llvm/System/Program.h
index 69ce47892e14f..7017305a2eb6a 100644
--- a/include/llvm/System/Program.h
+++ b/include/llvm/System/Program.h
@@ -116,7 +116,6 @@ namespace sys {
/// locations to search (e.g. the PATH on Unix).
/// @returns A Path object initialized to the path of the program or a
/// Path object that is empty (invalid) if the program could not be found.
- /// @throws nothing
/// @brief Construct a Program by finding it by name.
static Path FindProgramByName(const std::string& name);
@@ -129,7 +128,6 @@ namespace sys {
/// A convenience function equivalent to Program prg; prg.Execute(..);
/// prg.Wait(..);
- /// @throws nothing
/// @see Execute, Wait
static int ExecuteAndWait(const Path& path,
const char** args,
@@ -140,7 +138,6 @@ namespace sys {
std::string* ErrMsg = 0);
/// A convenience function equivalent to Program prg; prg.Execute(..);
- /// @throws nothing
/// @see Execute
static void ExecuteNoWait(const Path& path,
const char** args,
diff --git a/include/llvm/System/Signals.h b/include/llvm/System/Signals.h
index 504420cd402dd..7f1c87c3d55a3 100644
--- a/include/llvm/System/Signals.h
+++ b/include/llvm/System/Signals.h
@@ -29,6 +29,10 @@ namespace sys {
/// @brief Remove a file if a fatal signal occurs.
bool RemoveFileOnSignal(const Path &Filename, std::string* ErrMsg = 0);
+ /// This function removes a file from the list of files to be removed on
+ /// signal delivery.
+ void DontRemoveFileOnSignal(const Path &Filename);
+
/// When an error signal (such as SIBABRT or SIGSEGV) is delivered to the
/// process, print a stack trace and then exit.
/// @brief Print a stack trace if a fatal signal occurs.
diff --git a/include/llvm/System/ThreadLocal.h b/include/llvm/System/ThreadLocal.h
index 39b1e64be0cdb..e6edd79d6ff1a 100644
--- a/include/llvm/System/ThreadLocal.h
+++ b/include/llvm/System/ThreadLocal.h
@@ -19,6 +19,8 @@
namespace llvm {
namespace sys {
+ // ThreadLocalImpl - Common base class of all ThreadLocal instantiations.
+ // YOU SHOULD NEVER USE THIS DIRECTLY.
class ThreadLocalImpl {
void* data;
public:
@@ -26,14 +28,25 @@ namespace llvm {
virtual ~ThreadLocalImpl();
void setInstance(const void* d);
const void* getInstance();
+ void removeInstance();
};
+ /// ThreadLocal - A class used to abstract thread-local storage. It holds,
+ /// for each thread, a pointer a single object of type T.
template<class T>
class ThreadLocal : public ThreadLocalImpl {
public:
ThreadLocal() : ThreadLocalImpl() { }
+
+ /// get - Fetches a pointer to the object associated with the current
+ /// thread. If no object has yet been associated, it returns NULL;
T* get() { return static_cast<T*>(getInstance()); }
+
+ // set - Associates a pointer to an object with the current thread.
void set(T* d) { setInstance(d); }
+
+ // erase - Removes the pointer associated with the current thread.
+ void erase() { removeInstance(); }
};
}
}