From 05651d45448c4be9b4319b5fb2c3b9aa98ab6f97 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 15 Dec 2009 06:14:33 +0000 Subject: [PATCH] add an ALWAYS_INLINE macro, which does the obvious thing. llvm-svn: 91416 --- include/llvm/Support/Compiler.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h index da31f986288..8861a209540 100644 --- a/include/llvm/Support/Compiler.h +++ b/include/llvm/Support/Compiler.h @@ -70,6 +70,16 @@ #define DISABLE_INLINE #endif +// ALWAYS_INLINE - On compilers where we have a directive to do so, mark a +// method "always inline" because it is performance sensitive. +#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +#define ALWAYS_INLINE __attribute__((always_inline)) +#else +// TODO: No idea how to do this with MSVC. +#define ALWAYS_INLINE +#endif + + #ifdef __GNUC__ #define NORETURN __attribute__((noreturn)) #elif defined(_MSC_VER)