assembly.h revision 239138
1214152Sed/* ===-- assembly.h - compiler-rt assembler support macros -----------------=== 2214152Sed * 3214152Sed * The LLVM Compiler Infrastructure 4214152Sed * 5222656Sed * This file is dual licensed under the MIT and the University of Illinois Open 6222656Sed * Source Licenses. See LICENSE.TXT for details. 7214152Sed * 8214152Sed * ===----------------------------------------------------------------------=== 9214152Sed * 10214152Sed * This file defines macros for use in compiler-rt assembler source. 11214152Sed * This file is not part of the interface of this library. 12214152Sed * 13214152Sed * ===----------------------------------------------------------------------=== 14214152Sed */ 15214152Sed 16214152Sed#ifndef COMPILERRT_ASSEMBLY_H 17214152Sed#define COMPILERRT_ASSEMBLY_H 18214152Sed 19214152Sed#if defined(__POWERPC__) || defined(__powerpc__) || defined(__ppc__) 20214152Sed#define SEPARATOR @ 21214152Sed#else 22214152Sed#define SEPARATOR ; 23214152Sed#endif 24214152Sed 25214152Sed#if defined(__APPLE__) 26222656Sed#define HIDDEN_DIRECTIVE .private_extern 27222656Sed#define LOCAL_LABEL(name) L_##name 28239138Sandrew#define FILE_LEVEL_DIRECTIVE .subsections_via_symbols 29214152Sed#else 30222656Sed#define HIDDEN_DIRECTIVE .hidden 31222656Sed#define LOCAL_LABEL(name) .L_##name 32239138Sandrew#define FILE_LEVEL_DIRECTIVE 33214152Sed#endif 34214152Sed 35222656Sed#define GLUE2(a, b) a ## b 36222656Sed#define GLUE(a, b) GLUE2(a, b) 37222656Sed#define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name) 38222656Sed 39214152Sed#ifdef VISIBILITY_HIDDEN 40229135Sed#define DECLARE_SYMBOL_VISIBILITY(name) \ 41229135Sed HIDDEN_DIRECTIVE SYMBOL_NAME(name) SEPARATOR 42214152Sed#else 43229135Sed#define DECLARE_SYMBOL_VISIBILITY(name) 44229135Sed#endif 45229135Sed 46222656Sed#define DEFINE_COMPILERRT_FUNCTION(name) \ 47239138Sandrew FILE_LEVEL_DIRECTIVE SEPARATOR \ 48222656Sed .globl SYMBOL_NAME(name) SEPARATOR \ 49229135Sed DECLARE_SYMBOL_VISIBILITY(name) \ 50214152Sed SYMBOL_NAME(name): 51214152Sed 52222656Sed#define DEFINE_COMPILERRT_PRIVATE_FUNCTION(name) \ 53222656Sed .globl SYMBOL_NAME(name) SEPARATOR \ 54222656Sed HIDDEN_DIRECTIVE SYMBOL_NAME(name) SEPARATOR \ 55214152Sed SYMBOL_NAME(name): 56214152Sed 57214152Sed#define DEFINE_COMPILERRT_PRIVATE_FUNCTION_UNMANGLED(name) \ 58222656Sed .globl name SEPARATOR \ 59222656Sed HIDDEN_DIRECTIVE name SEPARATOR \ 60214152Sed name: 61214152Sed 62222656Sed#define DEFINE_COMPILERRT_FUNCTION_ALIAS(name, target) \ 63222656Sed .globl SYMBOL_NAME(name) SEPARATOR \ 64222656Sed .set SYMBOL_NAME(name), SYMBOL_NAME(target) SEPARATOR 65222656Sed 66222656Sed#if defined (__ARM_EABI__) 67222656Sed# define DEFINE_AEABI_FUNCTION_ALIAS(aeabi_name, name) \ 68222656Sed DEFINE_COMPILERRT_FUNCTION_ALIAS(aeabi_name, name) 69222656Sed#else 70222656Sed# define DEFINE_AEABI_FUNCTION_ALIAS(aeabi_name, name) 71222656Sed#endif 72222656Sed 73214152Sed#endif /* COMPILERRT_ASSEMBLY_H */ 74