blob: 0a8e4e6ac6db81d5442516cd72019a0041187e7f [file] [log] [blame]
Anton Korobeynikovd05ca652007-01-16 16:41:57 +00001//===--- X86COFF.h - Some definitions from COFF documentations ------------===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Anton Korobeynikovd05ca652007-01-16 16:41:57 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This file just defines some symbols found in COFF documentation. They are
11// used to emit function type information for COFF targets (Cygwin/Mingw32).
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef X86COFF_H
16#define X86COFF_H
17
18namespace COFF
19{
Anton Korobeynikov1e0f3382007-01-16 18:23:09 +000020/// Storage class tells where and what the symbol represents
Anton Korobeynikovd05ca652007-01-16 16:41:57 +000021enum StorageClass {
Anton Korobeynikov1e0f3382007-01-16 18:23:09 +000022 C_EFCN = -1, ///< Physical end of function
23 C_NULL = 0, ///< No symbol
24 C_AUTO = 1, ///< External definition
25 C_EXT = 2, ///< External symbol
26 C_STAT = 3, ///< Static
27 C_REG = 4, ///< Register variable
28 C_EXTDEF = 5, ///< External definition
29 C_LABEL = 6, ///< Label
30 C_ULABEL = 7, ///< Undefined label
31 C_MOS = 8, ///< Member of structure
32 C_ARG = 9, ///< Function argument
33 C_STRTAG = 10, ///< Structure tag
34 C_MOU = 11, ///< Member of union
35 C_UNTAG = 12, ///< Union tag
36 C_TPDEF = 13, ///< Type definition
37 C_USTATIC = 14, ///< Undefined static
38 C_ENTAG = 15, ///< Enumeration tag
39 C_MOE = 16, ///< Member of enumeration
40 C_REGPARM = 17, ///< Register parameter
41 C_FIELD = 18, ///< Bit field
Anton Korobeynikovd05ca652007-01-16 16:41:57 +000042
Anton Korobeynikov1e0f3382007-01-16 18:23:09 +000043 C_BLOCK = 100, ///< ".bb" or ".eb" - beginning or end of block
44 C_FCN = 101, ///< ".bf" or ".ef" - beginning or end of function
45 C_EOS = 102, ///< End of structure
46 C_FILE = 103, ///< File name
47 C_LINE = 104, ///< Line number, reformatted as symbol
48 C_ALIAS = 105, ///< Duplicate tag
49 C_HIDDEN = 106 ///< External symbol in dmert public lib
Anton Korobeynikovd05ca652007-01-16 16:41:57 +000050};
51
Anton Korobeynikov1e0f3382007-01-16 18:23:09 +000052/// The type of the symbol. This is made up of a base type and a derived type.
53/// For example, pointer to int is "pointer to T" and "int"
Anton Korobeynikovd05ca652007-01-16 16:41:57 +000054enum SymbolType {
Anton Korobeynikov1e0f3382007-01-16 18:23:09 +000055 T_NULL = 0, ///< No type info
56 T_ARG = 1, ///< Void function argument (only used by compiler)
57 T_VOID = 1, ///< The same as above. Just named differently in some specs.
58 T_CHAR = 2, ///< Character
59 T_SHORT = 3, ///< Short integer
60 T_INT = 4, ///< Integer
61 T_LONG = 5, ///< Long integer
62 T_FLOAT = 6, ///< Floating point
63 T_DOUBLE = 7, ///< Double word
64 T_STRUCT = 8, ///< Structure
65 T_UNION = 9, ///< Union
66 T_ENUM = 10, ///< Enumeration
67 T_MOE = 11, ///< Member of enumeration
68 T_UCHAR = 12, ///< Unsigned character
69 T_USHORT = 13, ///< Unsigned short
70 T_UINT = 14, ///< Unsigned integer
71 T_ULONG = 15 ///< Unsigned long
Anton Korobeynikovd05ca652007-01-16 16:41:57 +000072};
73
Anton Korobeynikov1e0f3382007-01-16 18:23:09 +000074/// Derived type of symbol
Anton Korobeynikovd05ca652007-01-16 16:41:57 +000075enum SymbolDerivedType {
Anton Korobeynikov1e0f3382007-01-16 18:23:09 +000076 DT_NON = 0, ///< No derived type
77 DT_PTR = 1, ///< Pointer to T
78 DT_FCN = 2, ///< Function returning T
79 DT_ARY = 3 ///< Array of T
Anton Korobeynikovd05ca652007-01-16 16:41:57 +000080};
81
Anton Korobeynikov1e0f3382007-01-16 18:23:09 +000082/// Masks for extracting parts of type
83enum SymbolTypeMasks {
84 N_BTMASK = 017, ///< Mask for base type
85 N_TMASK = 060 ///< Mask for derived type
86};
87
88/// Offsets of parts of type
89enum Shifts {
Anton Korobeynikovb93a7c92007-01-16 20:22:18 +000090 N_BTSHFT = 4 ///< Type is formed as (base + derived << N_BTSHIFT)
Anton Korobeynikovd05ca652007-01-16 16:41:57 +000091};
92
93}
94
95#endif // X86COFF_H