LLVM API Documentation

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
 Defines __GNUC_PREREQ if glibc's features.h isn't available.
#define LLVM_NOEXCEPT   noexcept
#define LLVM_HAS_RVALUE_REFERENCE_THIS   0
 Does the compiler support r-value reference *this?
#define LLVM_HAS_VARIADIC_TEMPLATES   0
 Does this compiler support variadic templates.
#define LLVM_LVALUE_FUNCTION
#define LLVM_DELETED_FUNCTION
#define LLVM_CONSTEXPR
#define LLVM_LIBRARY_VISIBILITY
#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
#define LLVM_ATTRIBUTE_ALWAYS_INLINE
#define LLVM_ATTRIBUTE_NORETURN
#define LLVM_ATTRIBUTE_RETURNS_NONNULL
#define LLVM_EXTENSION
#define LLVM_ATTRIBUTE_DEPRECATED(decl, message)   decl
#define LLVM_BUILTIN_TRAP   *(volatile int*)0x11 = 0
#define LLVM_ASSUME_ALIGNED(p, a)   (p)
 Returns a pointer with an assumed alignment.
#define LLVM_FUNCTION_NAME   __func__
 Expands to __func__ on compilers which support it. Otherwise, expands to a compiler-dependent replacement.
#define LLVM_MEMORY_SANITIZER_BUILD   0
 Whether LLVM itself is built with MemorySanitizer instrumentation.
#define __msan_allocated_memory(p, size)
#define __msan_unpoison(p, size)
#define LLVM_ADDRESS_SANITIZER_BUILD   0
 Whether LLVM itself is built with AddressSanitizer instrumentation.
#define LLVM_IS_UNALIGNED_ACCESS_FAST   0
 Is unaligned memory access fast on the host machine.
#define LLVM_EXPLICIT
 Expands to explicit on compilers which support explicit conversion operators. Otherwise expands to nothing.
#define LLVM_HAS_INITIALIZER_LISTS   0
 Does the compiler support generalized initializers (using braced lists and std::initializer_list). While clang may claim it supports general initializers, if we're using MSVC's headers, we might not have a usable std::initializer list type from the STL. Disable this for now.
#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 __msan_allocated_memory (   p,
  size 
)
#define __msan_unpoison (   p,
  size 
)

Definition at line 314 of file Compiler.h.

Definition at line 205 of file Compiler.h.

Whether LLVM itself is built with AddressSanitizer instrumentation.

LLVM_ADDRESS_SANITIZER_BUILD

Definition at line 322 of file Compiler.h.

#define LLVM_ASSUME_ALIGNED (   p,
 
)    (p)

Returns a pointer with an assumed alignment.

LLVM_ASSUME_ALIGNED

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

#define LLVM_ATTRIBUTE_DEPRECATED (   decl,
  message 
)    decl

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

Definition at line 236 of file Compiler.h.

Definition at line 242 of file Compiler.h.

Definition at line 161 of file Compiler.h.

Referenced by LowerCONCAT_VECTORS().

Definition at line 147 of file Compiler.h.

Definition at line 141 of file Compiler.h.

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

#define LLVM_CONSTEXPR

Definition at line 123 of file Compiler.h.

LLVM_DELETED_FUNCTION - Expands to = delete if the compiler supports it. Use to mark functions as uncallable. Member functions with this should be declared private so that some behavior is kept in C++03 mode.

class DontCopy { private: DontCopy(const DontCopy&) LLVM_DELETED_FUNCTION; DontCopy &operator =(const DontCopy&) LLVM_DELETED_FUNCTION; public: ... };

Definition at line 117 of file Compiler.h.

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

Definition at line 362 of file Compiler.h.

#define LLVM_EXPLICIT

Expands to explicit on compilers which support explicit conversion operators. Otherwise expands to nothing.

LLVM_EXPLICIT

Definition at line 345 of file Compiler.h.

#define LLVM_EXTENSION

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

Definition at line 250 of file Compiler.h.

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

#define LLVM_FUNCTION_NAME   __func__

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

LLVM_FUNCTION_NAME

Definition at line 303 of file Compiler.h.

Does the compiler support generalized initializers (using braced lists and std::initializer_list). While clang may claim it supports general initializers, if we're using MSVC's headers, we might not have a usable std::initializer list type from the STL. Disable this for now.

Definition at line 355 of file Compiler.h.

Does the compiler support r-value reference *this?

Sadly, this is separate from just r-value reference support because GCC implemented everything but this thus far. No release of GCC yet has support for this feature so it is enabled with Clang only. FIXME: This should change to a version check when GCC grows support for it.

Definition at line 79 of file Compiler.h.

Does this compiler support variadic templates.

LLVM_HAS_VARIADIC_TEMPLATES Implies LLVM_HAS_RVALUE_REFERENCES and the existence of std::forward.

Definition at line 89 of file Compiler.h.

Is unaligned memory access fast on the host machine.

LLVM_IS_UNALIGNED_ACCESS_FAST Don't specialize on alignment for platforms where unaligned memory accesses generates the same code as aligned memory accesses for common types.

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

#define LLVM_LIKELY (   EXPR)    (EXPR)

Expands to '&' if r-value references are supported.

This can be used to provide l-value/r-value overrides of member functions. The r-value override should be guarded by LLVM_HAS_RVALUE_REFERENCE_THIS

Definition at line 99 of file Compiler.h.

Whether LLVM itself is built with MemorySanitizer instrumentation.

LLVM_MEMORY_SANITIZER_BUILD

Definition at line 312 of file Compiler.h.

#define LLVM_MSC_PREREQ (   version)    0

Defines __GNUC_PREREQ if glibc's features.h isn't available.

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

Parameters:
versionvalues to check for are: 1700: Microsoft Visual Studio 2012 / 11.0 1800: Microsoft Visual Studio 2013 / 12.0

Definition at line 61 of file Compiler.h.

#define LLVM_NOEXCEPT   noexcept

Definition at line 65 of file Compiler.h.

#define LLVM_READNONE

Definition at line 178 of file Compiler.h.

#define LLVM_READONLY

Definition at line 185 of file Compiler.h.

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

Definition at line 206 of file Compiler.h.