2009-10-28 01:49:50 +08:00
|
|
|
/* ===-- assembly.h - compiler-rt assembler support macros -----------------===
|
|
|
|
*
|
|
|
|
* The LLVM Compiler Infrastructure
|
|
|
|
*
|
2010-11-17 06:13:33 +08:00
|
|
|
* This file is dual licensed under the MIT and the University of Illinois Open
|
|
|
|
* Source Licenses. See LICENSE.TXT for details.
|
2009-10-28 01:49:50 +08:00
|
|
|
*
|
|
|
|
* ===----------------------------------------------------------------------===
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
|
|
|
|
#if defined(__POWERPC__) || defined(__powerpc__) || defined(__ppc__)
|
|
|
|
#define SEPARATOR @
|
|
|
|
#else
|
|
|
|
#define SEPARATOR ;
|
2010-01-19 06:19:25 +08:00
|
|
|
#endif
|
2009-10-28 01:49:50 +08:00
|
|
|
|
2010-01-19 06:19:25 +08:00
|
|
|
#if defined(__APPLE__)
|
2011-04-20 01:50:09 +08:00
|
|
|
#define HIDDEN_DIRECTIVE .private_extern
|
|
|
|
#define LOCAL_LABEL(name) L_##name
|
2012-07-12 03:21:39 +08:00
|
|
|
#define FILE_LEVEL_DIRECTIVE .subsections_via_symbols
|
2010-01-19 06:19:25 +08:00
|
|
|
#else
|
2011-04-20 01:50:09 +08:00
|
|
|
#define HIDDEN_DIRECTIVE .hidden
|
|
|
|
#define LOCAL_LABEL(name) .L_##name
|
2012-07-12 03:21:39 +08:00
|
|
|
#define FILE_LEVEL_DIRECTIVE
|
2009-10-28 01:49:50 +08:00
|
|
|
#endif
|
|
|
|
|
2011-04-20 05:22:14 +08:00
|
|
|
#define GLUE2(a, b) a ## b
|
|
|
|
#define GLUE(a, b) GLUE2(a, b)
|
|
|
|
#define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name)
|
|
|
|
|
2012-02-11 00:41:46 +08:00
|
|
|
#ifdef VISIBILITY_HIDDEN
|
2011-08-23 05:49:47 +08:00
|
|
|
#define DECLARE_SYMBOL_VISIBILITY(name) \
|
2012-02-11 00:41:46 +08:00
|
|
|
HIDDEN_DIRECTIVE SYMBOL_NAME(name) SEPARATOR
|
2010-01-19 06:19:34 +08:00
|
|
|
#else
|
2011-08-23 05:49:47 +08:00
|
|
|
#define DECLARE_SYMBOL_VISIBILITY(name)
|
|
|
|
#endif
|
|
|
|
|
2011-04-20 01:50:09 +08:00
|
|
|
#define DEFINE_COMPILERRT_FUNCTION(name) \
|
2012-07-12 03:21:39 +08:00
|
|
|
FILE_LEVEL_DIRECTIVE SEPARATOR \
|
2011-04-20 01:50:09 +08:00
|
|
|
.globl SYMBOL_NAME(name) SEPARATOR \
|
2012-02-11 00:41:46 +08:00
|
|
|
DECLARE_SYMBOL_VISIBILITY(name) \
|
2009-10-28 01:49:50 +08:00
|
|
|
SYMBOL_NAME(name):
|
|
|
|
|
2011-04-20 01:50:09 +08:00
|
|
|
#define DEFINE_COMPILERRT_PRIVATE_FUNCTION(name) \
|
|
|
|
.globl SYMBOL_NAME(name) SEPARATOR \
|
|
|
|
HIDDEN_DIRECTIVE SYMBOL_NAME(name) SEPARATOR \
|
2009-10-28 01:49:50 +08:00
|
|
|
SYMBOL_NAME(name):
|
|
|
|
|
2010-01-19 06:19:20 +08:00
|
|
|
#define DEFINE_COMPILERRT_PRIVATE_FUNCTION_UNMANGLED(name) \
|
2011-04-20 01:50:09 +08:00
|
|
|
.globl name SEPARATOR \
|
|
|
|
HIDDEN_DIRECTIVE name SEPARATOR \
|
2010-01-19 06:19:20 +08:00
|
|
|
name:
|
|
|
|
|
2011-04-20 01:51:24 +08:00
|
|
|
#define DEFINE_COMPILERRT_FUNCTION_ALIAS(name, target) \
|
|
|
|
.globl SYMBOL_NAME(name) SEPARATOR \
|
|
|
|
.set SYMBOL_NAME(name), SYMBOL_NAME(target) SEPARATOR
|
|
|
|
|
|
|
|
#if defined (__ARM_EABI__)
|
|
|
|
# define DEFINE_AEABI_FUNCTION_ALIAS(aeabi_name, name) \
|
|
|
|
DEFINE_COMPILERRT_FUNCTION_ALIAS(aeabi_name, name)
|
|
|
|
#else
|
|
|
|
# define DEFINE_AEABI_FUNCTION_ALIAS(aeabi_name, name)
|
|
|
|
#endif
|
|
|
|
|
2009-10-28 01:49:50 +08:00
|
|
|
#endif /* COMPILERRT_ASSEMBLY_H */
|