LLVM  9.0.0svn
Compiler.h File Reference
#include "llvm/Config/llvm-config.h"
#include <new>
#include <stddef.h>
Include dependency graph for Compiler.h:

Go to the source code of this file.

Namespaces

llvm
This class represents lattice values for constants.

Macros

#define __has_feature(x)   0

#define __has_extension(x)   0

#define __has_attribute(x)   0

#define __has_cpp_attribute(x)   0

#define __has_builtin(x)   0

#define LLVM_GNUC_PREREQ(maj, min, patch)   0
LLVM_GNUC_PREREQ Extend the default __GNUC_PREREQ even if glibc's features.h isn't available. More...

#define LLVM_MSC_PREREQ(version)   0
LLVM_MSC_PREREQ Is the compiler MSVC of at least the specified version? The common More...

#define LLVM_HAS_RVALUE_REFERENCE_THIS   0
Does the compiler support ref-qualifiers for *this? More...

#define LLVM_LVALUE_FUNCTION
Expands to '&' if ref-qualifiers for *this are supported. More...

#define LLVM_LIBRARY_VISIBILITY
LLVM_LIBRARY_VISIBILITY - If a class marked with this attribute is linked into a shared library, then the class should be private to the library and not accessible from outside it. More...

#define LLVM_ATTRIBUTE_USED

LLVM_NODISCARD - Warn if a type or return value is discarded. More...

#define LLVM_ATTRIBUTE_REINITIALIZES

#define LLVM_ATTRIBUTE_UNUSED

#define LLVM_ATTRIBUTE_WEAK

#define LLVM_LIKELY(EXPR)   (EXPR)

#define LLVM_UNLIKELY(EXPR)   (EXPR)

#define LLVM_ATTRIBUTE_NOINLINE
LLVM_ATTRIBUTE_NOINLINE - On compilers where we have a directive to do so, mark a method "not for inlining". More...

#define LLVM_ATTRIBUTE_ALWAYS_INLINE
LLVM_ATTRIBUTE_ALWAYS_INLINE - On compilers where we have a directive to do so, mark a method "always inline" because it is performance sensitive. More...

#define LLVM_ATTRIBUTE_NORETURN

#define LLVM_ATTRIBUTE_RETURNS_NONNULL

#define LLVM_ATTRIBUTE_RETURNS_NOALIAS
LLVM_ATTRIBUTE_RETURNS_NOALIAS Used to mark a function as returning a pointer that does not alias any other valid pointer. More...

#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements. More...

#define LLVM_EXTENSION
LLVM_EXTENSION - Support compilers where we have a keyword to suppress pedantic diagnostics. More...

#define LLVM_ATTRIBUTE_DEPRECATED(decl, message)   decl

#define LLVM_BUILTIN_TRAP   *(volatile int*)0x11 = 0
LLVM_BUILTIN_UNREACHABLE - On compilers which support it, expands to an expression which states that it is undefined behavior for the compiler to reach this point. More...

#define LLVM_BUILTIN_DEBUGTRAP
LLVM_BUILTIN_DEBUGTRAP - On compilers which support it, expands to an expression which causes the program to break while running under a debugger. More...

#define LLVM_ASSUME_ALIGNED(p, a)   (p)
LLVM_ASSUME_ALIGNED Returns a pointer with an assumed alignment. More...

#define LLVM_ALIGNAS(x)   alignas(x)
LLVM_ALIGNAS Used to specify a minimum alignment for a structure or variable. More...

#define LLVM_PACKED(d)   d __attribute__((packed))
LLVM_PACKED Used to specify a packed structure. More...

#define LLVM_PACKED_START   _Pragma("pack(push, 1)")

#define LLVM_PACKED_END   _Pragma("pack(pop)")

#define LLVM_PTR_SIZE   sizeof(void *)
LLVM_PTR_SIZE A constant integer equivalent to the value of sizeof(void*). More...

#define LLVM_MEMORY_SANITIZER_BUILD   0
LLVM_MEMORY_SANITIZER_BUILD Whether LLVM itself is built with MemorySanitizer instrumentation. More...

#define __msan_allocated_memory(p, size)

#define __msan_unpoison(p, size)

#define __asan_poison_memory_region(p, size)

#define __asan_unpoison_memory_region(p, size)

#define TsanHappensBefore(cv)

#define TsanHappensAfter(cv)

#define TsanIgnoreWritesBegin()

#define TsanIgnoreWritesEnd()

#define LLVM_NO_SANITIZE(KIND)
LLVM_NO_SANITIZE Disable a particular sanitizer for a function. More...

#define LLVM_DUMP_METHOD   LLVM_ATTRIBUTE_NOINLINE LLVM_ATTRIBUTE_USED
Mark debug helper function definitions like dump() that should not be stripped from debug builds. More...

#define LLVM_PRETTY_FUNCTION   __func__
LLVM_PRETTY_FUNCTION Gets a user-friendly looking function signature for the current scope using the best available method on each platform. More...

LLVM_THREAD_LOCAL A thread-local storage specifier which can be used with globals, extern globals, and static globals. More...

Functions

void * llvm::allocate_buffer (size_t Size, size_t Alignment)
Allocate a buffer of memory with the given size and alignment. More...

void llvm::deallocate_buffer (void *Ptr, size_t Size, size_t Alignment)
Deallocate a buffer of memory with the given size and alignment. More...

◆ __asan_poison_memory_region

 #define __asan_poison_memory_region ( p, size )

Definition at line 403 of file Compiler.h.

◆ __asan_unpoison_memory_region

 #define __asan_unpoison_memory_region ( p, size )

Definition at line 404 of file Compiler.h.

◆ __has_attribute

 #define __has_attribute ( x ) 0

Definition at line 36 of file Compiler.h.

◆ __has_builtin

 #define __has_builtin ( x ) 0

Definition at line 44 of file Compiler.h.

◆ __has_cpp_attribute

 #define __has_cpp_attribute ( x ) 0

Definition at line 40 of file Compiler.h.

◆ __has_extension

 #define __has_extension ( x ) 0

Definition at line 32 of file Compiler.h.

◆ __has_feature

 #define __has_feature ( x ) 0

Definition at line 28 of file Compiler.h.

◆ __msan_allocated_memory

 #define __msan_allocated_memory ( p, size )

Definition at line 392 of file Compiler.h.

◆ __msan_unpoison

 #define __msan_unpoison ( p, size )

Definition at line 393 of file Compiler.h.

Referenced by llvm::zlib::compress(), and llvm::zlib::uncompress().

Definition at line 402 of file Compiler.h.

◆ LLVM_ALIGNAS

 #define LLVM_ALIGNAS ( x ) alignas(x)

LLVM_ALIGNAS Used to specify a minimum alignment for a structure or variable.

Definition at line 338 of file Compiler.h.

◆ LLVM_ASSUME_ALIGNED

 #define LLVM_ASSUME_ALIGNED ( p, a ) (p)

LLVM_ASSUME_ALIGNED Returns a pointer with an assumed alignment.

Definition at line 330 of file Compiler.h.

◆ LLVM_ATTRIBUTE_ALWAYS_INLINE

 #define LLVM_ATTRIBUTE_ALWAYS_INLINE

LLVM_ATTRIBUTE_ALWAYS_INLINE - On compilers where we have a directive to do so, mark a method "always inline" because it is performance sensitive.

GCC 3.4 supported this but is buggy in various cases and produces unimplemented errors, just use it in GCC 4.0 and later.

Definition at line 214 of file Compiler.h.

◆ LLVM_ATTRIBUTE_DEPRECATED

 #define LLVM_ATTRIBUTE_DEPRECATED ( decl, message ) decl

Definition at line 277 of file Compiler.h.

◆ LLVM_ATTRIBUTE_NOINLINE

 #define LLVM_ATTRIBUTE_NOINLINE

LLVM_ATTRIBUTE_NOINLINE - On compilers where we have a directive to do so, mark a method "not for inlining".

Definition at line 202 of file Compiler.h.

◆ LLVM_ATTRIBUTE_NORETURN

 #define LLVM_ATTRIBUTE_NORETURN

Definition at line 222 of file Compiler.h.

◆ LLVM_ATTRIBUTE_REINITIALIZES

 #define LLVM_ATTRIBUTE_REINITIALIZES

Definition at line 146 of file Compiler.h.

◆ LLVM_ATTRIBUTE_RETURNS_NOALIAS

 #define LLVM_ATTRIBUTE_RETURNS_NOALIAS

LLVM_ATTRIBUTE_RETURNS_NOALIAS Used to mark a function as returning a pointer that does not alias any other valid pointer.

Definition at line 240 of file Compiler.h.

◆ LLVM_ATTRIBUTE_RETURNS_NONNULL

 #define LLVM_ATTRIBUTE_RETURNS_NONNULL

Definition at line 230 of file Compiler.h.

◆ LLVM_ATTRIBUTE_UNUSED

 #define LLVM_ATTRIBUTE_UNUSED

◆ LLVM_ATTRIBUTE_USED

 #define LLVM_ATTRIBUTE_USED

Definition at line 120 of file Compiler.h.

◆ LLVM_ATTRIBUTE_WEAK

 #define LLVM_ATTRIBUTE_WEAK

Definition at line 168 of file Compiler.h.

Referenced by llvm::jit_noop().

◆ LLVM_BUILTIN_DEBUGTRAP

 #define LLVM_BUILTIN_DEBUGTRAP

LLVM_BUILTIN_DEBUGTRAP - On compilers which support it, expands to an expression which causes the program to break while running under a debugger.

Definition at line 318 of file Compiler.h.

◆ LLVM_BUILTIN_TRAP

 #define LLVM_BUILTIN_TRAP   *(volatile int*)0x11 = 0

LLVM_BUILTIN_UNREACHABLE - On compilers which support it, expands to an expression which states that it is undefined behavior for the compiler to reach this point.

Otherwise is not defined. LLVM_BUILTIN_TRAP - On compilers which support it, expands to an expression which causes the program to exit abnormally.

Definition at line 301 of file Compiler.h.

◆ LLVM_DUMP_METHOD

 #define LLVM_DUMP_METHOD   LLVM_ATTRIBUTE_NOINLINE LLVM_ATTRIBUTE_USED

Mark debug helper function definitions like dump() that should not be stripped from debug builds.

Note that you should also surround dump() functions with if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) so they do always get stripped in release builds.

Definition at line 465 of file Compiler.h.

◆ LLVM_EXTENSION

 #define LLVM_EXTENSION

LLVM_EXTENSION - Support compilers where we have a keyword to suppress pedantic diagnostics.

Definition at line 263 of file Compiler.h.

◆ LLVM_FALLTHROUGH

 #define LLVM_FALLTHROUGH

LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.

Definition at line 251 of file Compiler.h.

◆ LLVM_GNUC_PREREQ

 #define LLVM_GNUC_PREREQ ( maj, min, patch ) 0

LLVM_GNUC_PREREQ Extend the default __GNUC_PREREQ even if glibc's features.h isn't available.

Definition at line 59 of file Compiler.h.

◆ LLVM_HAS_RVALUE_REFERENCE_THIS

 #define LLVM_HAS_RVALUE_REFERENCE_THIS   0

Does the compiler support ref-qualifiers for *this?

Sadly, this is separate from just rvalue reference support because GCC and MSVC implemented this later than everything else.

Definition at line 86 of file Compiler.h.

◆ LLVM_LIBRARY_VISIBILITY

 #define LLVM_LIBRARY_VISIBILITY

LLVM_LIBRARY_VISIBILITY - If a class marked with this attribute is linked into a shared library, then the class should be private to the library and not accessible from outside it.

Can also be used to mark variables and functions, making them private to any shared library they are linked into. On PE/COFF targets, library visibility is the default, so this isn't needed.

Definition at line 108 of file Compiler.h.

◆ LLVM_LVALUE_FUNCTION

 #define LLVM_LVALUE_FUNCTION

Expands to '&' if ref-qualifiers for *this are supported.

This can be used to provide lvalue/rvalue overrides of member functions. The rvalue override should be guarded by LLVM_HAS_RVALUE_REFERENCE_THIS

Definition at line 96 of file Compiler.h.

◆ LLVM_MEMORY_SANITIZER_BUILD

 #define LLVM_MEMORY_SANITIZER_BUILD   0

LLVM_MEMORY_SANITIZER_BUILD Whether LLVM itself is built with MemorySanitizer instrumentation.

Definition at line 391 of file Compiler.h.

◆ LLVM_MSC_PREREQ

 #define LLVM_MSC_PREREQ ( version ) 0

LLVM_MSC_PREREQ Is the compiler MSVC of at least the specified version? The common

Parameters
 version values to check for are: 1900: Microsoft Visual Studio 2015 / 14.0

Definition at line 76 of file Compiler.h.

◆ LLVM_NO_SANITIZE

 #define LLVM_NO_SANITIZE ( KIND )

LLVM_NO_SANITIZE Disable a particular sanitizer for a function.

Definition at line 455 of file Compiler.h.

◆ LLVM_PACKED

 #define LLVM_PACKED ( d ) d __attribute__((packed))

LLVM_PACKED Used to specify a packed structure.

LLVM_PACKED( struct A { int i; int j; int k; long long l; });

LLVM_PACKED_START struct B { int i; int j; int k; long long l; }; LLVM_PACKED_END

Definition at line 364 of file Compiler.h.

◆ LLVM_PACKED_END

 #define LLVM_PACKED_END   _Pragma("pack(pop)")

Definition at line 366 of file Compiler.h.

◆ LLVM_PACKED_START

 #define LLVM_PACKED_START   _Pragma("pack(push, 1)")

Definition at line 365 of file Compiler.h.

◆ LLVM_PREFETCH

 #define LLVM_PREFETCH ( addr, rw, locality )

Definition at line 114 of file Compiler.h.

◆ LLVM_PRETTY_FUNCTION

 #define LLVM_PRETTY_FUNCTION   __func__

LLVM_PRETTY_FUNCTION Gets a user-friendly looking function signature for the current scope using the best available method on each platform.

The exact format of the resulting string is implementation specific and non-portable, so this should only be used, for example, for logging or diagnostics.

Definition at line 480 of file Compiler.h.

◆ LLVM_PTR_SIZE

 #define LLVM_PTR_SIZE   sizeof(void *)

LLVM_PTR_SIZE A constant integer equivalent to the value of sizeof(void*).

Generally used in combination with LLVM_ALIGNAS or when doing computation in the preprocessor.

Definition at line 382 of file Compiler.h.

Definition at line 177 of file Compiler.h.

LLVM_THREAD_LOCAL A thread-local storage specifier which can be used with globals, extern globals, and static globals.

This is essentially an extremely restricted analog to C++11's thread_local support, and uses that when available. However, it falls back on platform-specific or vendor-provided extensions when necessary. These extensions don't support many of the C++11 thread_local's features. You should only use this for PODs that you can statically initialize to some constant value. In almost all circumstances this is most appropriate for use with a pointer, integer, or small aggregation of pointers and integers.

Definition at line 504 of file Compiler.h.

Definition at line 412 of file Compiler.h.

◆ TsanHappensAfter

 #define TsanHappensAfter ( cv )

Definition at line 445 of file Compiler.h.

Referenced by llvm::call_once().

◆ TsanHappensBefore

 #define TsanHappensBefore ( cv )

Definition at line 444 of file Compiler.h.

Referenced by llvm::call_once().

◆ TsanIgnoreWritesBegin

 #define TsanIgnoreWritesBegin ( )

Definition at line 446 of file Compiler.h.

Referenced by llvm::call_once().

◆ TsanIgnoreWritesEnd

 #define TsanIgnoreWritesEnd ( )

Definition at line 447 of file Compiler.h.

Referenced by llvm::call_once().