LLVM  mainline
Defines
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_READNONE
#define LLVM_READONLY
#define LLVM_LIKELY(EXPR)   (EXPR)
#define LLVM_UNLIKELY(EXPR)   (EXPR)
#define EXTERN_TEMPLATE_INSTANTIATION(X)
#define TEMPLATE_INSTANTIATION(X)
#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_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 LLVM_ADDRESS_SANITIZER_BUILD   0
 LLVM_ADDRESS_SANITIZER_BUILD
#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 LLVM_THREAD_LOCAL   __thread
 LLVM_THREAD_LOCAL

Define Documentation

#define __msan_allocated_memory (   p,
  size 
)
#define __msan_unpoison (   p,
  size 
)

Definition at line 342 of file Compiler.h.

Definition at line 186 of file Compiler.h.

LLVM_ADDRESS_SANITIZER_BUILD

Whether LLVM itself is built with AddressSanitizer instrumentation.

Definition at line 350 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 306 of file Compiler.h.

#define LLVM_ASSUME_ALIGNED (   p,
 
)    (p)

LLVM_ASSUME_ALIGNED

Returns a pointer with an assumed alignment.

Definition at line 291 of file Compiler.h.

Referenced by llvm::support::endian::read(), and llvm::support::endian::write().

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

#define LLVM_ATTRIBUTE_DEPRECATED (   decl,
  message 
)    decl

Definition at line 255 of file Compiler.h.

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

Definition at line 197 of file Compiler.h.

Definition at line 217 of file Compiler.h.

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

Definition at line 233 of file Compiler.h.

Definition at line 223 of file Compiler.h.

Definition at line 142 of file Compiler.h.

Definition at line 128 of file Compiler.h.

Definition at line 122 of file Compiler.h.

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

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

Referenced by bindingsErrorHandler(), LLVMContextSetDiagnosticHandler(), LLVMContextSetYieldCallback(), and LLVMInstallFatalErrorHandler().

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

Referenced by llvm::HexagonFrameLowering::assignCalleeSavedSpillSlots(), and llvm::HexagonTargetLowering::LowerDYNAMIC_STACKALLOC().

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.

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)

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.

LLVM_MEMORY_SANITIZER_BUILD

Whether LLVM itself is built with MemorySanitizer instrumentation.

Definition at line 340 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:
versionvalues 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_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 322 of file Compiler.h.

#define LLVM_READNONE

Definition at line 159 of file Compiler.h.

#define LLVM_READONLY

Definition at line 166 of file Compiler.h.

#define LLVM_THREAD_LOCAL   __thread

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

#define LLVM_UNLIKELY (   EXPR)    (EXPR)
#define TEMPLATE_INSTANTIATION (   X)

Definition at line 187 of file Compiler.h.