summaryrefslogtreecommitdiff
path: root/include/linux/compiler-clang.h
diff options
context:
space:
mode:
authorMark Charlebois <charlebm@gmail.com>2012-11-21 01:13:10 +0400
committerBehan Webster <behanw@converseincode.com>2014-04-10 00:44:35 +0400
commit565cbdc2fec92ef2ae75995e06e69172ed2edecd (patch)
tree5f28a812a1ec430e87827cabd654b8429527bb36 /include/linux/compiler-clang.h
parentaa93685afbefa0e31af3a0a03ff97b37ee92a90b (diff)
downloadlinux-565cbdc2fec92ef2ae75995e06e69172ed2edecd.tar.xz
LLVMLinux: Add support for clang to compiler.h and new compiler-clang.h
Add a compiler-clang.h file to add specific macros needed for compiling the kernel with clang. Initially the only override required is the macro for silencing the compiler for a purposefully uninintialized variable. Author: Mark Charlebois <charlebm@gmail.com> Signed-off-by: Mark Charlebois <charlebm@gmail.com> Signed-off-by: Behan Webster <behanw@converseincode.com>
Diffstat (limited to 'include/linux/compiler-clang.h')
-rw-r--r--include/linux/compiler-clang.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
new file mode 100644
index 000000000000..d1e49d52b640
--- /dev/null
+++ b/include/linux/compiler-clang.h
@@ -0,0 +1,12 @@
+#ifndef __LINUX_COMPILER_H
+#error "Please don't include <linux/compiler-clang.h> directly, include <linux/compiler.h> instead."
+#endif
+
+/* Some compiler specific definitions are overwritten here
+ * for Clang compiler
+ */
+
+#ifdef uninitialized_var
+#undef uninitialized_var
+#define uninitialized_var(x) x = *(&(x))
+#endif