Daniel Dunbar | 19336a2 | 2009-10-27 17:49:50 +0000 | [diff] [blame] | 1 | /* ===-- assembly.h - compiler-rt assembler support macros -----------------=== |
| 2 | * |
| 3 | * The LLVM Compiler Infrastructure |
| 4 | * |
| 5 | * This file is distributed under the University of Illinois Open Source |
| 6 | * License. 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 | |
Daniel Dunbar | 19336a2 | 2009-10-27 17:49:50 +0000 | [diff] [blame] | 19 | #if defined(__POWERPC__) || defined(__powerpc__) || defined(__ppc__) |
Daniel Dunbar | 19336a2 | 2009-10-27 17:49:50 +0000 | [diff] [blame] | 20 | #define SEPARATOR @ |
Daniel Dunbar | 19336a2 | 2009-10-27 17:49:50 +0000 | [diff] [blame] | 21 | #else |
Daniel Dunbar | 19336a2 | 2009-10-27 17:49:50 +0000 | [diff] [blame] | 22 | #define SEPARATOR ; |
Daniel Dunbar | 4c01bb7 | 2010-01-18 22:19:25 +0000 | [diff] [blame] | 23 | #endif |
Daniel Dunbar | 19336a2 | 2009-10-27 17:49:50 +0000 | [diff] [blame] | 24 | |
Daniel Dunbar | 4c01bb7 | 2010-01-18 22:19:25 +0000 | [diff] [blame] | 25 | /* We can't use __USER_LABEL_PREFIX__ here, it isn't possible to concatenate the |
| 26 | *values* of two macros. This is quite brittle, though. */ |
| 27 | #if defined(__APPLE__) |
| 28 | #define SYMBOL_NAME(name) _##name |
| 29 | #else |
| 30 | #define SYMBOL_NAME(name) name |
Daniel Dunbar | 19336a2 | 2009-10-27 17:49:50 +0000 | [diff] [blame] | 31 | #endif |
| 32 | |
Daniel Dunbar | 6a571fb | 2010-01-18 22:19:34 +0000 | [diff] [blame^] | 33 | #ifdef VISIBILITY_HIDDEN |
| 34 | #define DEFINE_COMPILERRT_FUNCTION(name) \ |
| 35 | .globl SYMBOL_NAME(name) SEPARATOR \ |
| 36 | .private_extern SYMBOL_NAME(name) SEPARATOR \ |
| 37 | SYMBOL_NAME(name): |
| 38 | #else |
Daniel Dunbar | 19336a2 | 2009-10-27 17:49:50 +0000 | [diff] [blame] | 39 | #define DEFINE_COMPILERRT_FUNCTION(name) \ |
| 40 | .globl SYMBOL_NAME(name) SEPARATOR \ |
| 41 | SYMBOL_NAME(name): |
Daniel Dunbar | 6a571fb | 2010-01-18 22:19:34 +0000 | [diff] [blame^] | 42 | #endif |
Daniel Dunbar | 19336a2 | 2009-10-27 17:49:50 +0000 | [diff] [blame] | 43 | |
| 44 | #define DEFINE_COMPILERRT_PRIVATE_FUNCTION(name) \ |
| 45 | .globl SYMBOL_NAME(name) SEPARATOR \ |
| 46 | .private_extern SYMBOL_NAME(name) SEPARATOR \ |
| 47 | SYMBOL_NAME(name): |
| 48 | |
Daniel Dunbar | e136da9 | 2010-01-18 22:19:20 +0000 | [diff] [blame] | 49 | #define DEFINE_COMPILERRT_PRIVATE_FUNCTION_UNMANGLED(name) \ |
| 50 | .globl name SEPARATOR \ |
| 51 | .private_extern name SEPARATOR \ |
| 52 | name: |
| 53 | |
Daniel Dunbar | 19336a2 | 2009-10-27 17:49:50 +0000 | [diff] [blame] | 54 | #endif /* COMPILERRT_ASSEMBLY_H */ |