Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / libc++abi / trunk / src / Unwind / assembly.h
1 /* ===-- assembly.h - libUnwind assembler support macros -------------------===
2  *
3  *                     The LLVM Compiler Infrastructure
4  *
5  * This file is dual licensed under the MIT and the University of Illinois Open
6  * Source Licenses. See LICENSE.TXT for details.
7  *
8  * ===----------------------------------------------------------------------===
9  *
10  * This file defines macros for use in libUnwind assembler source.
11  * This file is not part of the interface of this library.
12  *
13  * ===----------------------------------------------------------------------===
14  */
15
16 #ifndef UNWIND_ASSEMBLY_H
17 #define UNWIND_ASSEMBLY_H
18
19 #if defined(__POWERPC__) || defined(__powerpc__) || defined(__ppc__)
20 #define SEPARATOR @
21 #elif defined(__arm64__)
22 #define SEPARATOR %%
23 #else
24 #define SEPARATOR ;
25 #endif
26
27 #if defined(__APPLE__)
28 #define HIDDEN_DIRECTIVE .private_extern
29 #else
30 #define HIDDEN_DIRECTIVE .hidden
31 #endif
32
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)
36
37 #if defined(__APPLE__)
38 #define SYMBOL_IS_FUNC(name)
39 #elif defined(__ELF__)
40 #if defined(__arm__)
41 #define SYMBOL_IS_FUNC(name) .type name,%function
42 #else
43 #define SYMBOL_IS_FUNC(name) .type name,@function
44 #endif
45 #else
46 #define SYMBOL_IS_FUNC(name)                                                   \
47   .def name SEPARATOR                                                          \
48     .scl 2 SEPARATOR                                                           \
49     .type 32 SEPARATOR                                                         \
50   .endef
51 #endif
52
53 #define DEFINE_LIBUNWIND_FUNCTION(name)                   \
54   .globl SYMBOL_NAME(name) SEPARATOR                      \
55   SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR             \
56   SYMBOL_NAME(name):
57
58 #define DEFINE_LIBUNWIND_PRIVATE_FUNCTION(name)           \
59   .globl SYMBOL_NAME(name) SEPARATOR                      \
60   HIDDEN_DIRECTIVE SYMBOL_NAME(name) SEPARATOR            \
61   SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR             \
62   SYMBOL_NAME(name):
63
64 #endif /* UNWIND_ASSEMBLY_H */