summaryrefslogtreecommitdiff
path: root/lib/assembly.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-10-27 17:49:50 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-10-27 17:49:50 +0000
commit19336a2d6b9b375ac106125950f4ff09742d1aec (patch)
treeeb2b4b2223c21a78fa78c553d750417da7e8b2dd /lib/assembly.h
parent51c80ccf6f7779c3b88e9ede81c0e0cfc35dc959 (diff)
Add assembly.h for use in .S files.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@85263 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/assembly.h')
-rw-r--r--lib/assembly.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/assembly.h b/lib/assembly.h
new file mode 100644
index 000000000..808f7e404
--- /dev/null
+++ b/lib/assembly.h
@@ -0,0 +1,42 @@
+/* ===-- assembly.h - compiler-rt assembler support macros -----------------===
+ *
+ * The LLVM Compiler Infrastructure
+ *
+ * This file is distributed under the University of Illinois Open Source
+ * License. See LICENSE.TXT for details.
+ *
+ * ===----------------------------------------------------------------------===
+ *
+ * This file defines macros for use in compiler-rt assembler source.
+ * This file is not part of the interface of this library.
+ *
+ * ===----------------------------------------------------------------------===
+ */
+
+#ifndef COMPILERRT_ASSEMBLY_H
+#define COMPILERRT_ASSEMBLY_H
+
+// Define SYMBOL_NAME to add the appropriate symbol prefix; we can't use
+// USER_LABEL_PREFIX directly because of cpp brokenness.
+#if defined(__POWERPC__) || defined(__powerpc__) || defined(__ppc__)
+
+#define SYMBOL_NAME(name) name
+#define SEPARATOR @
+
+#else
+
+#define SYMBOL_NAME(name) _##name
+#define SEPARATOR ;
+
+#endif
+
+#define DEFINE_COMPILERRT_FUNCTION(name) \
+ .globl SYMBOL_NAME(name) SEPARATOR \
+ SYMBOL_NAME(name):
+
+#define DEFINE_COMPILERRT_PRIVATE_FUNCTION(name) \
+ .globl SYMBOL_NAME(name) SEPARATOR \
+ .private_extern SYMBOL_NAME(name) SEPARATOR \
+ SYMBOL_NAME(name):
+
+#endif /* COMPILERRT_ASSEMBLY_H */