aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Support/Compiler.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-15 06:14:33 +0000
committerChris Lattner <sabre@nondot.org>2009-12-15 06:14:33 +0000
commit54fec492a4c81ee84265ad953f4212eda9aff5c1 (patch)
tree2004c9e589f4a3f7c3b1d473eb8eac44ac6f90ca /include/llvm/Support/Compiler.h
parent428c804a753234ecaf6a6177107361a1312508f8 (diff)
downloadexternal_llvm-54fec492a4c81ee84265ad953f4212eda9aff5c1.zip
external_llvm-54fec492a4c81ee84265ad953f4212eda9aff5c1.tar.gz
external_llvm-54fec492a4c81ee84265ad953f4212eda9aff5c1.tar.bz2
add an ALWAYS_INLINE macro, which does the obvious thing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91416 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/Compiler.h')
-rw-r--r--include/llvm/Support/Compiler.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h
index da31f98..8861a20 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)