LLVM API Documentation
Classes | |
| class | DynamicLibrary |
| class | MemoryBlock |
| Memory block abstraction. More... | |
| class | Memory |
| An abstraction for memory operations. More... | |
| class | MutexImpl |
| Platform agnostic Mutex class. More... | |
| class | SmartMutex |
| class | SmartScopedLock |
| class | FileStatus |
| File status structure. More... | |
| class | Path |
| An abstraction for operating system paths. More... | |
| class | PathWithStatus |
| Path with file status class. More... | |
| class | Process |
| An abstraction for operating system processes. More... | |
| class | Program |
| An abstraction for finding and executing programs. More... | |
| class | RWMutexImpl |
| Platform agnostic RWMutex class. More... | |
| class | SmartRWMutex |
| struct | SmartScopedReader |
| ScopedReader - RAII acquisition of a reader lock. More... | |
| struct | SmartScopedWriter |
| ScopedWriter - RAII acquisition of a writer lock. More... | |
| class | ThreadLocalImpl |
| class | ThreadLocal |
| class | TimeValue |
| Provides an abstraction for a fixed point in time. More... | |
Typedefs | |
| typedef uint32_t | cas_flag |
| typedef SmartMutex< false > | Mutex |
| Mutex - A standard, always enforced mutex. | |
| typedef SmartScopedLock< false > | ScopedLock |
| typedef SmartRWMutex< false > | RWMutex |
| typedef SmartScopedReader< false > | ScopedReader |
| typedef SmartScopedWriter< false > | ScopedWriter |
Enumerations | |
| enum | LLVMFileType { Unknown_FileType = 0, Bitcode_FileType, Archive_FileType, ELF_Relocatable_FileType, ELF_Executable_FileType, ELF_SharedObject_FileType, ELF_Core_FileType, Mach_O_Object_FileType, Mach_O_Executable_FileType, Mach_O_FixedVirtualMemorySharedLib_FileType, Mach_O_Core_FileType, Mach_O_PreloadExectuable_FileType, Mach_O_DynamicallyLinkedSharedLib_FileType, Mach_O_DynamicLinker_FileType, Mach_O_Bundle_FileType, Mach_O_DynamicallyLinkedSharedLibStub_FileType, COFF_FileType } |
| This enumeration delineates the kinds of files that LLVM knows about. More... | |
Functions | |
| void | SetupAlarm (unsigned seconds) |
| void | TerminateAlarm () |
| int | AlarmStatus () |
| void | Sleep (unsigned n) |
| void | MemoryFence () |
| cas_flag | CompareAndSwap (volatile cas_flag *ptr, cas_flag new_value, cas_flag old_value) |
| cas_flag | AtomicIncrement (volatile cas_flag *ptr) |
| cas_flag | AtomicDecrement (volatile cas_flag *ptr) |
| cas_flag | AtomicAdd (volatile cas_flag *ptr, cas_flag val) |
| cas_flag | AtomicMul (volatile cas_flag *ptr, cas_flag val) |
| cas_flag | AtomicDiv (volatile cas_flag *ptr, cas_flag val) |
| bool | hasDisassembler () |
| std::string | disassembleBuffer (uint8_t *start, size_t length, uint64_t pc=0) |
| std::string | StrError () |
| std::string | StrError (int errnum) |
Like the no-argument version above, but uses errnum instead of errno. | |
| bool | isLittleEndianHost () |
| bool | isBigEndianHost () |
| std::string | getHostTriple () |
| LLVMFileType | IdentifyFileType (const char *magic, unsigned length) |
| bool | CopyFile (const Path &Dest, const Path &Src, std::string *ErrMsg) |
| Copy one file to another. | |
| bool | RemoveFileOnSignal (const Path &Filename, std::string *ErrMsg=0) |
| Remove a file if a fatal signal occurs. | |
| void | PrintStackTraceOnErrorSignal () |
| Print a stack trace if a fatal signal occurs. | |
| void | AddSignalHandler (void(*FnPtr)(void *), void *Cookie) |
| 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) |
Variables | |
| const char | PathSeparator |
| typedef uint32_t llvm::sys::cas_flag |
| typedef SmartMutex<false> llvm::sys::Mutex |
| typedef SmartRWMutex<false> llvm::sys::RWMutex |
| typedef SmartScopedLock<false> llvm::sys::ScopedLock |
| typedef SmartScopedReader<false> llvm::sys::ScopedReader |
| typedef SmartScopedWriter<false> llvm::sys::ScopedWriter |
This enumeration delineates the kinds of files that LLVM knows about.
| Unknown_FileType | Unrecognized file. |
| Bitcode_FileType | Bitcode file. |
| Archive_FileType | ar style archive file |
| ELF_Relocatable_FileType | ELF Relocatable object file. |
| ELF_Executable_FileType | ELF Executable image. |
| ELF_SharedObject_FileType | ELF dynamically linked shared lib. |
| ELF_Core_FileType | ELF core image. |
| Mach_O_Object_FileType | Mach-O Object file. |
| Mach_O_Executable_FileType | Mach-O Executable. |
| Mach_O_FixedVirtualMemorySharedLib_FileType | Mach-O Shared Lib, FVM. |
| Mach_O_Core_FileType | Mach-O Core File. |
| Mach_O_PreloadExectuable_FileType | Mach-O Preloaded Executable. |
| Mach_O_DynamicallyLinkedSharedLib_FileType | Mach-O dynlinked shared lib. |
| Mach_O_DynamicLinker_FileType | The Mach-O dynamic linker. |
| Mach_O_Bundle_FileType | Mach-O Bundle file. |
| Mach_O_DynamicallyLinkedSharedLibStub_FileType | Mach-O Shared lib stub. |
| COFF_FileType | COFF object file or lib. |
| void llvm::sys::AddSignalHandler | ( | void(*)(void *) | FnPtr, | |
| void * | Cookie | |||
| ) |
AddSignalHandler - Add a function to be called when an abort/kill signal is delivered to the process. The handler can have a cookie passed to it to identify what instance of the handler it is.
Referenced by RegisterCrashPrinter().
| int llvm::sys::AlarmStatus | ( | ) |
This function acquires the status of the alarm.
Referenced by llvm::SlowOperationInformer::progress().
| cas_flag llvm::sys::AtomicAdd | ( | volatile cas_flag * | ptr, | |
| cas_flag | val | |||
| ) |
Referenced by llvm::Statistic::operator+=(), and llvm::Statistic::operator-=().
| cas_flag llvm::sys::AtomicDecrement | ( | volatile cas_flag * | ptr | ) |
Referenced by llvm::AttributeListImpl::DropRef(), llvm::Type::dropRef(), and llvm::Statistic::operator--().
| cas_flag llvm::sys::AtomicDiv | ( | volatile cas_flag * | ptr, | |
| cas_flag | val | |||
| ) |
Referenced by llvm::Statistic::operator/=().
| cas_flag llvm::sys::AtomicIncrement | ( | volatile cas_flag * | ptr | ) |
Referenced by llvm::Type::addRef(), llvm::AttributeListImpl::AddRef(), and llvm::Statistic::operator++().
| cas_flag llvm::sys::AtomicMul | ( | volatile cas_flag * | ptr, | |
| cas_flag | val | |||
| ) |
Referenced by llvm::Statistic::operator*=().
| cas_flag llvm::sys::CompareAndSwap | ( | volatile cas_flag * | ptr, | |
| cas_flag | new_value, | |||
| cas_flag | old_value | |||
| ) |
| bool llvm::sys::CopyFile | ( | const Path & | Dest, | |
| const Path & | Src, | |||
| std::string * | ErrMsg | |||
| ) |
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 llvm::sys::disassembleBuffer | ( | uint8_t * | start, | |
| size_t | length, | |||
| uint64_t | pc = 0 | |||
| ) |
This function provides some "glue" code to call external disassembler libraries.
Definition at line 43 of file Disassembler.cpp.
| std::string llvm::sys::getHostTriple | ( | ) |
getHostTriple() - Return the target triple of the running system.
The target triple is a string in the format of: CPU_TYPE-VENDOR-OPERATING_SYSTEM or CPU_TYPE-VENDOR-KERNEL-OPERATING_SYSTEM
Referenced by llvm::TargetRegistry::getClosestTargetForJIT(), and llvm::JIT::selectTarget().
| bool llvm::sys::hasDisassembler | ( | ) |
This function returns true, if there is possible to use some external disassembler library. False otherwise.
Definition at line 29 of file Disassembler.cpp.
| 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 56 of file Path.cpp.
References Archive_FileType, Bitcode_FileType, COFF_FileType, ELF_Core_FileType, ELF_Executable_FileType, ELF_Relocatable_FileType, ELF_SharedObject_FileType, Mach_O_Bundle_FileType, Mach_O_Core_FileType, Mach_O_DynamicallyLinkedSharedLib_FileType, Mach_O_DynamicallyLinkedSharedLibStub_FileType, Mach_O_DynamicLinker_FileType, Mach_O_Executable_FileType, Mach_O_FixedVirtualMemorySharedLib_FileType, Mach_O_Object_FileType, Mach_O_PreloadExectuable_FileType, type, and Unknown_FileType.
Referenced by llvm::Archive::addFileBefore(), llvm::sys::Path::isBitcodeFile(), llvm::sys::Path::isDynamicLibrary(), llvm::Linker::LinkInFile(), llvm::Linker::LinkInLibrary(), llvm::Archive::parseMemberHeader(), and llvm::ArchiveMember::replaceWith().
| bool llvm::sys::isBigEndianHost | ( | ) | [inline] |
| bool llvm::sys::isLittleEndianHost | ( | ) | [inline] |
Definition at line 22 of file Host.h.
References c.
Referenced by isBigEndianHost(), LoadIntFromMemory(), llvm::ExecutionEngine::LoadValueFromMemory(), StoreIntToMemory(), and llvm::ExecutionEngine::StoreValueToMemory().
| void llvm::sys::MemoryFence | ( | ) |
Definition at line 24 of file Atomic.cpp.
Referenced by llvm::DerivedType::dropAllTypeUses(), getDefaultTimerGroup(), getPassRegistrar(), llvm::Statistic::init(), llvm::llvm_start_multithreaded(), llvm::llvm_stop_multithreaded(), llvm::ManagedStatic< C >::operator*(), llvm::ManagedStatic< C >::operator->(), llvm::ManagedStaticBase::RegisterManagedStatic(), and llvm::Statistic::RegisterStatistic().
| TimeValue llvm::sys::operator+ | ( | const TimeValue & | tv1, | |
| const TimeValue & | tv2 | |||
| ) | [inline] |
Adds two TimeValue objects together.
Definition at line 367 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 373 of file TimeValue.h.
References llvm::sys::TimeValue::nanos_, llvm::sys::TimeValue::normalize(), and llvm::sys::TimeValue::seconds_.
| 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.
| bool llvm::sys::RemoveFileOnSignal | ( | const Path & | Filename, | |
| std::string * | ErrMsg = 0 | |||
| ) |
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::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.
| 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::Sleep | ( | unsigned | n | ) |
Sleep for n seconds. Warning: mixing calls to Sleep() and other *Alarm calls may be a bad idea on some platforms (source: Linux man page).
| std::string llvm::sys::StrError | ( | int | errnum | ) |
| std::string llvm::sys::StrError | ( | ) |
Returns a string representation of the errno value, using whatever thread-safe variant of strerror() is available. Be sure to call this immediately after the function that set errno, or errno may have been overwritten by an intervening call.
Definition at line 33 of file Errno.cpp.
Referenced by MakeErrMsg().
| void llvm::sys::TerminateAlarm | ( | ) |
This function terminates the alarm previously set up
Referenced by llvm::SlowOperationInformer::~SlowOperationInformer().
| const char llvm::sys::PathSeparator |
This is the OS-specific path separator: a colon on Unix or a semicolon on Windows.
Referenced by getPathList().