LLVM  3.7.0
Macros
Compiler.h File Reference
#include "llvm/Config/llvm-config.h"
Include dependency graph for Compiler.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define __has_feature(x)   0
 
#define __has_extension(x)   0
 
#define __has_attribute(x)   0
 
#define __has_builtin(x)   0
 
#define LLVM_GNUC_PREREQ(maj, min, patch)   0
 LLVM_GNUC_PREREQ More...
 
#define LLVM_MSC_PREREQ(version)   0
 LLVM_MSC_PREREQ More...
 
#define LLVM_NOEXCEPT   noexcept
 
#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_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. More...
 
#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 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_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_ASSUME_ALIGNED(p, a)   (p)
 LLVM_ASSUME_ALIGNED More...
 
#define LLVM_ALIGNAS(x)   alignas(x)
 LLVM_ALIGNAS More...
 
#define LLVM_PTR_SIZE   sizeof(void *)
 LLVM_PTR_SIZE More...
 
#define LLVM_FUNCTION_NAME   __func__
 LLVM_FUNCTION_NAME More...
 
#define LLVM_MEMORY_SANITIZER_BUILD   0
 LLVM_MEMORY_SANITIZER_BUILD More...
 
#define __msan_allocated_memory(p, size)
 
#define __msan_unpoison(p, size)
 
#define LLVM_ADDRESS_SANITIZER_BUILD   0
 LLVM_ADDRESS_SANITIZER_BUILD 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_THREAD_LOCAL   __thread
 LLVM_THREAD_LOCAL More...
 

Macro Definition Documentation

#define __has_attribute (   x)    0

Definition at line 29 of file Compiler.h.

#define __has_builtin (   x)    0

Definition at line 33 of file Compiler.h.

#define __has_extension (   x)    0

Definition at line 25 of file Compiler.h.

#define __has_feature (   x)    0

Definition at line 21 of file Compiler.h.

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

Definition at line 329 of file Compiler.h.

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

#define LLVM_ADDRESS_SANITIZER_BUILD   0

LLVM_ADDRESS_SANITIZER_BUILD

Whether LLVM itself is built with AddressSanitizer instrumentation.

Definition at line 337 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,
 
)    (p)

LLVM_ASSUME_ALIGNED

Returns a pointer with an assumed alignment.

Definition at line 278 of file Compiler.h.

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

#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().

#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.

Definition at line 344 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.

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

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

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

#define LLVM_MSC_PREREQ (   version)    0

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

#define LLVM_UNLIKELY (   EXPR)    (EXPR)