assembly.h revision 222656
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 28214152Sed#else 29222656Sed#define HIDDEN_DIRECTIVE .hidden 30222656Sed#define LOCAL_LABEL(name) .L_##name 31214152Sed#endif 32214152Sed 33222656Sed#define GLUE2(a, b) a ## b 34222656Sed#define GLUE(a, b) GLUE2(a, b) 35222656Sed#define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name) 36222656Sed 37214152Sed#ifdef VISIBILITY_HIDDEN 38222656Sed#define DEFINE_COMPILERRT_FUNCTION(name) \ 39222656Sed .globl SYMBOL_NAME(name) SEPARATOR \ 40222656Sed HIDDEN_DIRECTIVE SYMBOL_NAME(name) SEPARATOR \ 41214152Sed SYMBOL_NAME(name): 42214152Sed#else 43222656Sed#define DEFINE_COMPILERRT_FUNCTION(name) \ 44222656Sed .globl SYMBOL_NAME(name) SEPARATOR \ 45214152Sed SYMBOL_NAME(name): 46214152Sed#endif 47214152Sed 48222656Sed#define DEFINE_COMPILERRT_PRIVATE_FUNCTION(name) \ 49222656Sed .globl SYMBOL_NAME(name) SEPARATOR \ 50222656Sed HIDDEN_DIRECTIVE SYMBOL_NAME(name) SEPARATOR \ 51214152Sed SYMBOL_NAME(name): 52214152Sed 53214152Sed#define DEFINE_COMPILERRT_PRIVATE_FUNCTION_UNMANGLED(name) \ 54222656Sed .globl name SEPARATOR \ 55222656Sed HIDDEN_DIRECTIVE name SEPARATOR \ 56214152Sed name: 57214152Sed 58222656Sed#define DEFINE_COMPILERRT_FUNCTION_ALIAS(name, target) \ 59222656Sed .globl SYMBOL_NAME(name) SEPARATOR \ 60222656Sed .set SYMBOL_NAME(name), SYMBOL_NAME(target) SEPARATOR 61222656Sed 62222656Sed#if defined (__ARM_EABI__) 63222656Sed# define DEFINE_AEABI_FUNCTION_ALIAS(aeabi_name, name) \ 64222656Sed DEFINE_COMPILERRT_FUNCTION_ALIAS(aeabi_name, name) 65222656Sed#else 66222656Sed# define DEFINE_AEABI_FUNCTION_ALIAS(aeabi_name, name) 67222656Sed#endif 68222656Sed 69214152Sed#endif /* COMPILERRT_ASSEMBLY_H */ 70