summaryrefslogtreecommitdiff
path: root/include/llvm/Support/Compiler.h
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-07-16 17:54:34 +0000
committerDevang Patel <dpatel@apple.com>2008-07-16 17:54:34 +0000
commit0d885d1661f87bd2dc25bfdacb29413f0be81bd4 (patch)
tree85662284bbac210edf64d70f9928901fca02e8a7 /include/llvm/Support/Compiler.h
parent5d0af038a718ff31b1ecf0894bae951e41960e0d (diff)
downloadllvm-0d885d1661f87bd2dc25bfdacb29413f0be81bd4.tar.gz
llvm-0d885d1661f87bd2dc25bfdacb29413f0be81bd4.tar.bz2
llvm-0d885d1661f87bd2dc25bfdacb29413f0be81bd4.tar.xz
Mark function used by asm block as used, otherwise optimizer may not see the use and may delete the function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53692 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/Compiler.h')
-rw-r--r--include/llvm/Support/Compiler.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h
index 1497dd61ed..9750579f2c 100644
--- a/include/llvm/Support/Compiler.h
+++ b/include/llvm/Support/Compiler.h
@@ -23,6 +23,11 @@
#define VISIBILITY_HIDDEN
#endif
+#if (__GNUC__ >= 4)
+#define ATTRIBUTE_USED __attribute__((__used__))
+#else
+#define ATTRIBUTE_USED
+#endif
// C++ doesn't support 'extern template' of template specializations. GCC does,
// but requires __extension__ before it. In the header, use this: