LLVM API Documentation
Classes | |
class | DynamicLibrary |
Portable dynamic library abstraction. More... | |
class | MappedFile |
An abstraction for memory mapped files. More... | |
class | MemoryBlock |
Memory block abstraction. More... | |
class | Memory |
An abstraction for memory operations. More... | |
class | Mutex |
Platform agnostic Mutex class. More... | |
class | Path |
An abstraction for operating system paths. More... | |
class | Process |
An abstraction for operating system processes. More... | |
class | Program |
An abstraction for finding and executing programs. More... | |
class | TimeValue |
Provides an abstraction for a fixed point in time. More... | |
Enumerations | |
enum | LLVMFileType { UnknownFileType = 0, BytecodeFileType = 1, CompressedBytecodeFileType = 2, ArchiveFileType = 3 } |
This enumeration delineates the kinds of files that LLVM knows about. More... | |
Functions | |
void | SetupAlarm (unsigned seconds) |
void | TerminateAlarm () |
int | AlarmStatus () |
LLVMFileType | IdentifyFileType (const char *magic, unsigned length) |
void | CopyFile (const Path &Dest, const Path &Src) |
Copy one file to another. | |
void | RemoveFileOnSignal (const Path &Filename) |
Remove a file if a fatal signal occurs. | |
void | RemoveDirectoryOnSignal (const Path &path) |
Remove a directory if a fatal signal occurs. | |
void | PrintStackTraceOnErrorSignal () |
Print a stack trace if a fatal signal occurs. | |
void | SetInterruptFunction (void(*IF)()) |
Register a function to be called when ctrl-c is pressed. | |
TimeValue | operator+ (const TimeValue &tv1, const TimeValue &tv2) |
TimeValue | operator- (const TimeValue &tv1, const TimeValue &tv2) |
void llvm::sys::SetupAlarm | ( | unsigned | seconds | ) |
This function registers an alarm to trigger some number of seconds
in the future. When that time arrives, the AlarmStatus function will begin to return 1 instead of 0. The user must poll the status of the alarm by making occasional calls to AlarmStatus. If the user sends an interrupt signal, AlarmStatus will begin returning -1, even if the alarm event occurred.
seconds | Number of seconds in future when alarm arrives |
Referenced by llvm::SlowOperationInformer::SlowOperationInformer().
void llvm::sys::TerminateAlarm | ( | ) |
This function terminates the alarm previously set up
Referenced by llvm::SlowOperationInformer::~SlowOperationInformer().
int llvm::sys::AlarmStatus | ( | ) |
This function acquires the status of the alarm.
Referenced by llvm::SlowOperationInformer::progress().
LLVMFileType llvm::sys::IdentifyFileType | ( | const char * | magic, | |
unsigned | length | |||
) |
This utility function allows any memory block to be examined in order to determine its file type.
Definition at line 37 of file Path.cpp.
References ArchiveFileType, BytecodeFileType, CompressedBytecodeFileType, and UnknownFileType.
Referenced by llvm::Archive::addFileBefore(), llvm::Linker::LinkInLibrary(), llvm::Archive::parseMemberHeader(), and llvm::ArchiveMember::replaceWith().
void llvm::sys::CopyFile | ( | const Path & | Dest, | |
const Path & | Src | |||
) |
Copy one file to another.
This function can be used to copy the file specified by Src to the file specified by Dest. If an error occurs, Dest is removed.
std::string | if an error opening or writing the files occurs. |
void llvm::sys::RemoveFileOnSignal | ( | const Path & | Filename | ) |
Remove a file if a fatal signal occurs.
This function registers signal handlers to ensure that if a signal gets delivered that the named file is removed.
Referenced by llvm::Archive::writeToDisk().
void llvm::sys::RemoveDirectoryOnSignal | ( | const Path & | path | ) |
Remove a directory if a fatal signal occurs.
This function registers a signal handler to ensure that if a fatal signal gets delivered to the process that the named directory and all its contents are removed.
void llvm::sys::PrintStackTraceOnErrorSignal | ( | ) |
Print a stack trace if a fatal signal occurs.
When an error signal (such as SIBABRT or SIGSEGV) is delivered to the process, print a stack trace and then exit.
void llvm::sys::SetInterruptFunction | ( | void(*)() | IF | ) |
Register a function to be called when ctrl-c is pressed.
This function registers a function to be called when the user "interrupts" the program (typically by pressing ctrl-c). When the user interrupts the program, the specified interrupt function is called instead of the program being killed, and the interrupt function automatically disabled. Note that interrupt functions are not allowed to call any non-reentrant functions. An null interrupt function pointer disables the current installed function. Note also that the handler may be executed on a different thread on some platforms.
TimeValue llvm::sys::operator+ | ( | const TimeValue & | tv1, | |
const TimeValue & | tv2 | |||
) | [inline] |
Adds two TimeValue objects together.
Definition at line 368 of file TimeValue.h.
References llvm::sys::TimeValue::nanos_, llvm::sys::TimeValue::normalize(), and llvm::sys::TimeValue::seconds_.
TimeValue llvm::sys::operator- | ( | const TimeValue & | tv1, | |
const TimeValue & | tv2 | |||
) | [inline] |
Subtracts two TimeValue objects.
Definition at line 374 of file TimeValue.h.
References llvm::sys::TimeValue::nanos_, llvm::sys::TimeValue::normalize(), and llvm::sys::TimeValue::seconds_.