LLVM  mainline
Compiler.h File Reference
#include "llvm/Config/llvm-config.h"
Include dependency graph for Compiler.h:

Go to the source code of this file.

## Defines

#define LLVM_MSC_PREREQ(version)   0
LLVM_GNUC_PREREQ
#define LLVM_NOEXCEPT   noexcept
#define LLVM_HAS_RVALUE_REFERENCE_THIS   0
Does the compiler support ref-qualifiers for *this?
#define LLVM_LVALUE_FUNCTION
Expands to '&' if ref-qualifiers for *this are supported.
#define LLVM_CONSTEXPR
#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.
#define LLVM_END_WITH_NULL
#define LLVM_ATTRIBUTE_USED
#define LLVM_ATTRIBUTE_UNUSED_RESULT
#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".
#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.
#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.
#define LLVM_EXTENSION
LLVM_EXTENSION - Support compilers where we have a keyword to suppress pedantic diagnostics.
#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.
#define LLVM_ASSUME_ALIGNED(p, a)   (p)
LLVM_ASSUME_ALIGNED
#define LLVM_ALIGNAS(x)   alignas(x)
LLVM_ALIGNAS
#define LLVM_PACKED(d)   d __attribute__((packed))
LLVM_PACKED
#define LLVM_PACKED_START   _Pragma("pack(push, 1)")
#define LLVM_PACKED_END   _Pragma("pack(pop)")
#define LLVM_PTR_SIZE   sizeof(void *)
LLVM_PTR_SIZE
#define LLVM_FUNCTION_NAME   __func__
LLVM_FUNCTION_NAME
#define LLVM_MEMORY_SANITIZER_BUILD   0
LLVM_MEMORY_SANITIZER_BUILD
#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_DUMP_METHOD   LLVM_ATTRIBUTE_NOINLINE LLVM_ATTRIBUTE_USED
Mark debug helper function definitions like dump() that should not be stripped from debug builds.

## Define Documentation

 #define __asan_poison_memory_region ( p, size )

Definition at line 367 of file Compiler.h.

 #define __asan_unpoison_memory_region ( p, size )

Definition at line 368 of file Compiler.h.

 #define __msan_allocated_memory ( p, size )

Definition at line 356 of file Compiler.h.

 #define __msan_unpoison ( p, size )

Definition at line 357 of file Compiler.h.

Whether LLVM itself is built with AddressSanitizer instrumentation.

Definition at line 366 of file Compiler.h.

 #define LLVM_ALIGNAS ( x ) alignas(x)

LLVM_ALIGNAS

Used to specify a minimum alignment for a structure or variable. The alignment must be a constant integer. Use LLVM_PTR_SIZE to compute alignments in terms of the size of a pointer.

Note that __declspec(align) has special quirks, it's not legal to pass a structure with __declspec(align) as a formal parameter.

Definition at line 293 of file Compiler.h.

 #define LLVM_ASSUME_ALIGNED ( p, a ) (p)

LLVM_ASSUME_ALIGNED

Returns a pointer with an assumed alignment.

Definition at line 278 of file Compiler.h.

 #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 196 of file Compiler.h.

 #define LLVM_ATTRIBUTE_DEPRECATED ( decl, message ) decl

Definition at line 242 of file Compiler.h.

 #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 184 of file Compiler.h.

 #define LLVM_ATTRIBUTE_NORETURN

Definition at line 204 of file Compiler.h.

 #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 220 of file Compiler.h.

 #define LLVM_ATTRIBUTE_RETURNS_NONNULL

Definition at line 210 of file Compiler.h.

 #define LLVM_ATTRIBUTE_UNUSED

Definition at line 142 of file Compiler.h.

 #define LLVM_ATTRIBUTE_UNUSED_RESULT

Definition at line 128 of file Compiler.h.

 #define LLVM_ATTRIBUTE_USED

Definition at line 122 of file Compiler.h.

 #define LLVM_ATTRIBUTE_WEAK

Definition at line 150 of file Compiler.h.

 #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 266 of file Compiler.h.

 #define LLVM_CONSTEXPR

Definition at line 98 of file Compiler.h.

Referenced by KnuthDiv().

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

Definition at line 414 of file Compiler.h.

 #define LLVM_END_WITH_NULL

Definition at line 116 of file Compiler.h.

 #define LLVM_EXTENSION

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

Definition at line 228 of file Compiler.h.

 #define LLVM_FUNCTION_NAME   __func__

LLVM_FUNCTION_NAME

Expands to __func__ on compilers which support it. Otherwise, expands to a compiler-dependent replacement.

Definition at line 346 of file Compiler.h.

 #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 82 of file Compiler.h.

 #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 110 of file Compiler.h.

 #define LLVM_LIKELY ( EXPR ) (EXPR)
 #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 92 of file Compiler.h.

 #define LLVM_MEMORY_SANITIZER_BUILD   0

LLVM_MEMORY_SANITIZER_BUILD

Whether LLVM itself is built with MemorySanitizer instrumentation.

Definition at line 355 of file Compiler.h.

 #define LLVM_MSC_PREREQ ( version ) 0

LLVM_GNUC_PREREQ

Extend the default __GNUC_PREREQ even if glibc's features.h isn't available. LLVM_MSC_PREREQ Is the compiler MSVC of at least the specified version? The common

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

Definition at line 66 of file Compiler.h.

 #define LLVM_NOEXCEPT   noexcept

Definition at line 70 of file Compiler.h.

 #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 319 of file Compiler.h.

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

Definition at line 321 of file Compiler.h.

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

Definition at line 320 of file Compiler.h.

 #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 337 of file Compiler.h.

Definition at line 159 of file Compiler.h.

Definition at line 166 of file Compiler.h.

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 440 of file Compiler.h.

Whether LLVM itself is built with ThreadSanitizer instrumentation.

Definition at line 376 of file Compiler.h.

 #define LLVM_UNLIKELY ( EXPR ) (EXPR)
 #define TsanHappensAfter ( cv )

Definition at line 405 of file Compiler.h.

 #define TsanHappensBefore ( cv )

Definition at line 404 of file Compiler.h.

 #define TsanIgnoreWritesBegin ( )

Definition at line 406 of file Compiler.h.

 #define TsanIgnoreWritesEnd ( )

Definition at line 407 of file Compiler.h.