1 /* ===-- assembly.h - compiler-rt assembler support macros -----------------===
3 * The LLVM Compiler Infrastructure
5 * This file is dual licensed under the MIT and the University of Illinois Open
6 * Source Licenses. See LICENSE.TXT for details.
8 * ===----------------------------------------------------------------------===
10 * This file defines macros for use in compiler-rt assembler source.
11 * This file is not part of the interface of this library.
13 * ===----------------------------------------------------------------------===
16 #ifndef COMPILERRT_ASSEMBLY_H
17 #define COMPILERRT_ASSEMBLY_H
19 #if defined(__POWERPC__) || defined(__powerpc__) || defined(__ppc__)
25 #if defined(__APPLE__)
26 #define HIDDEN_DIRECTIVE .private_extern
27 #define LOCAL_LABEL(name) L_##name
29 #define HIDDEN_DIRECTIVE .hidden
30 #define LOCAL_LABEL(name) .L_##name
33 #define GLUE2(a, b) a ## b
34 #define GLUE(a, b) GLUE2(a, b)
35 #define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name)
37 #ifdef VISIBILITY_HIDDEN
38 #define DECLARE_SYMBOL_VISIBILITY(name) \
39 HIDDEN_DIRECTIVE SYMBOL_NAME(name) SEPARATOR
41 #define DECLARE_SYMBOL_VISIBILITY(name)
44 #define DEFINE_COMPILERRT_FUNCTION(name) \
45 .globl SYMBOL_NAME(name) SEPARATOR \
46 DECLARE_SYMBOL_VISIBILITY(name) \
49 #define DEFINE_COMPILERRT_PRIVATE_FUNCTION(name) \
50 .globl SYMBOL_NAME(name) SEPARATOR \
51 HIDDEN_DIRECTIVE SYMBOL_NAME(name) SEPARATOR \
54 #define DEFINE_COMPILERRT_PRIVATE_FUNCTION_UNMANGLED(name) \
55 .globl name SEPARATOR \
56 HIDDEN_DIRECTIVE name SEPARATOR \
59 #define DEFINE_COMPILERRT_FUNCTION_ALIAS(name, target) \
60 .globl SYMBOL_NAME(name) SEPARATOR \
61 .set SYMBOL_NAME(name), SYMBOL_NAME(target) SEPARATOR
63 #if defined (__ARM_EABI__)
64 # define DEFINE_AEABI_FUNCTION_ALIAS(aeabi_name, name) \
65 DEFINE_COMPILERRT_FUNCTION_ALIAS(aeabi_name, name)
67 # define DEFINE_AEABI_FUNCTION_ALIAS(aeabi_name, name)
70 #endif /* COMPILERRT_ASSEMBLY_H */