blob: fda09c293eba83c2019b2ce3e9ecca66f22ebf44 [file] [log] [blame]
Daniel Dunbar19336a22009-10-27 17:49:50 +00001/* ===-- 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
19// Define SYMBOL_NAME to add the appropriate symbol prefix; we can't use
20// USER_LABEL_PREFIX directly because of cpp brokenness.
21#if defined(__POWERPC__) || defined(__powerpc__) || defined(__ppc__)
22
23#define SYMBOL_NAME(name) name
24#define SEPARATOR @
25
26#else
27
Rafael Espindola6f608d52009-11-09 14:27:04 +000028#define SYMBOL_NAME(name) #__USER_LABEL_PREFIX__ ##name
Daniel Dunbar19336a22009-10-27 17:49:50 +000029#define SEPARATOR ;
30
31#endif
32
33#define DEFINE_COMPILERRT_FUNCTION(name) \
34 .globl SYMBOL_NAME(name) SEPARATOR \
35 SYMBOL_NAME(name):
36
37#define DEFINE_COMPILERRT_PRIVATE_FUNCTION(name) \
38 .globl SYMBOL_NAME(name) SEPARATOR \
39 .private_extern SYMBOL_NAME(name) SEPARATOR \
40 SYMBOL_NAME(name):
41
Daniel Dunbare136da92010-01-18 22:19:20 +000042#define DEFINE_COMPILERRT_PRIVATE_FUNCTION_UNMANGLED(name) \
43 .globl name SEPARATOR \
44 .private_extern name SEPARATOR \
45 name:
46
Daniel Dunbar19336a22009-10-27 17:49:50 +000047#endif /* COMPILERRT_ASSEMBLY_H */