tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

assembly.h (2108B)


      1 /* ===-- assembly.h - compiler-rt 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 compiler-rt assembler source.
     11 * This file is not part of the interface of this library.
     12 *
     13 * ===----------------------------------------------------------------------===
     14 */
     15 
     16 #ifndef COMPILERRT_ASSEMBLY_H
     17 #define COMPILERRT_ASSEMBLY_H
     18 
     19 #if defined(__POWERPC__) || defined(__powerpc__) || defined(__ppc__)
     20 #  define SEPARATOR @
     21 #else
     22 #  define SEPARATOR ;
     23 #endif
     24 
     25 #if defined(__APPLE__)
     26 #  define HIDDEN_DIRECTIVE .private_extern
     27 #  define LOCAL_LABEL(name) L_##name
     28 #else
     29 #  define HIDDEN_DIRECTIVE .hidden
     30 #  define LOCAL_LABEL(name) .L_##name
     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 #ifdef VISIBILITY_HIDDEN
     38 #  define DECLARE_SYMBOL_VISIBILITY(name) \
     39    HIDDEN_DIRECTIVE SYMBOL_NAME(name) SEPARATOR
     40 #else
     41 #  define DECLARE_SYMBOL_VISIBILITY(name)
     42 #endif
     43 
     44 #define DEFINE_COMPILERRT_FUNCTION(name) \
     45  .globl SYMBOL_NAME(name)               \
     46  SEPARATOR DECLARE_SYMBOL_VISIBILITY(name) SYMBOL_NAME(name) :
     47 
     48 #define DEFINE_COMPILERRT_PRIVATE_FUNCTION(name) \
     49  .globl SYMBOL_NAME(name)                       \
     50  SEPARATOR HIDDEN_DIRECTIVE SYMBOL_NAME(name)   \
     51  SEPARATOR SYMBOL_NAME(name) :
     52 
     53 #define DEFINE_COMPILERRT_PRIVATE_FUNCTION_UNMANGLED(name) \
     54  .globl name SEPARATOR HIDDEN_DIRECTIVE name SEPARATOR name:
     55 
     56 #define DEFINE_COMPILERRT_FUNCTION_ALIAS(name, target)      \
     57  .globl SYMBOL_NAME(name) SEPARATOR.set SYMBOL_NAME(name), \
     58      SYMBOL_NAME(target) SEPARATOR
     59 
     60 #if defined(__ARM_EABI__)
     61 #  define DEFINE_AEABI_FUNCTION_ALIAS(aeabi_name, name) \
     62    DEFINE_COMPILERRT_FUNCTION_ALIAS(aeabi_name, name)
     63 #else
     64 #  define DEFINE_AEABI_FUNCTION_ALIAS(aeabi_name, name)
     65 #endif
     66 
     67 #endif /* COMPILERRT_ASSEMBLY_H */