Mercurial > projects > ldc
annotate gen/metadata.h @ 1291:875afb7a93b6
Factor out some constants into the header so producers and consumers of
metadata stay in sync (and are more readable).
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Sat, 02 May 2009 20:42:58 +0200 |
parents | 5851c18e4c6d |
children | 8c65217be813 |
rev | line source |
---|---|
1284
5851c18e4c6d
Add metadata for TypeInfo -> llvm::Type mapping.
Frits van Bommel <fvbommel wxs.nl>
parents:
diff
changeset
|
1 #ifndef LDC_GEN_METADATA_H |
5851c18e4c6d
Add metadata for TypeInfo -> llvm::Type mapping.
Frits van Bommel <fvbommel wxs.nl>
parents:
diff
changeset
|
2 #define LDC_GEN_METADATA_H |
5851c18e4c6d
Add metadata for TypeInfo -> llvm::Type mapping.
Frits van Bommel <fvbommel wxs.nl>
parents:
diff
changeset
|
3 |
5851c18e4c6d
Add metadata for TypeInfo -> llvm::Type mapping.
Frits van Bommel <fvbommel wxs.nl>
parents:
diff
changeset
|
4 #include "gen/llvm-version.h" |
5851c18e4c6d
Add metadata for TypeInfo -> llvm::Type mapping.
Frits van Bommel <fvbommel wxs.nl>
parents:
diff
changeset
|
5 |
5851c18e4c6d
Add metadata for TypeInfo -> llvm::Type mapping.
Frits van Bommel <fvbommel wxs.nl>
parents:
diff
changeset
|
6 #if LLVM_REV >= 68420 |
1291
875afb7a93b6
Factor out some constants into the header so producers and consumers of
Frits van Bommel <fvbommel wxs.nl>
parents:
1284
diff
changeset
|
7 // Yay, we have metadata! |
875afb7a93b6
Factor out some constants into the header so producers and consumers of
Frits van Bommel <fvbommel wxs.nl>
parents:
1284
diff
changeset
|
8 |
875afb7a93b6
Factor out some constants into the header so producers and consumers of
Frits van Bommel <fvbommel wxs.nl>
parents:
1284
diff
changeset
|
9 #define USE_METADATA |
875afb7a93b6
Factor out some constants into the header so producers and consumers of
Frits van Bommel <fvbommel wxs.nl>
parents:
1284
diff
changeset
|
10 #define METADATA_LINKAGE_TYPE llvm::GlobalValue::WeakODRLinkage |
875afb7a93b6
Factor out some constants into the header so producers and consumers of
Frits van Bommel <fvbommel wxs.nl>
parents:
1284
diff
changeset
|
11 |
875afb7a93b6
Factor out some constants into the header so producers and consumers of
Frits van Bommel <fvbommel wxs.nl>
parents:
1284
diff
changeset
|
12 // *** Metadata for TypeInfo instances *** |
875afb7a93b6
Factor out some constants into the header so producers and consumers of
Frits van Bommel <fvbommel wxs.nl>
parents:
1284
diff
changeset
|
13 #define TD_PREFIX "llvm.ldc.typeinfo." |
875afb7a93b6
Factor out some constants into the header so producers and consumers of
Frits van Bommel <fvbommel wxs.nl>
parents:
1284
diff
changeset
|
14 |
875afb7a93b6
Factor out some constants into the header so producers and consumers of
Frits van Bommel <fvbommel wxs.nl>
parents:
1284
diff
changeset
|
15 /// The fields in the metadata node for a TypeInfo instance. |
875afb7a93b6
Factor out some constants into the header so producers and consumers of
Frits van Bommel <fvbommel wxs.nl>
parents:
1284
diff
changeset
|
16 /// (Its name will be TD_PREFIX ~ <Name of TypeInfo global>) |
875afb7a93b6
Factor out some constants into the header so producers and consumers of
Frits van Bommel <fvbommel wxs.nl>
parents:
1284
diff
changeset
|
17 enum TypeDataFields { |
875afb7a93b6
Factor out some constants into the header so producers and consumers of
Frits van Bommel <fvbommel wxs.nl>
parents:
1284
diff
changeset
|
18 TD_Confirm, /// The TypeInfo this node is for |
875afb7a93b6
Factor out some constants into the header so producers and consumers of
Frits van Bommel <fvbommel wxs.nl>
parents:
1284
diff
changeset
|
19 TD_Type, /// A value of the LLVM type corresponding to this D type |
875afb7a93b6
Factor out some constants into the header so producers and consumers of
Frits van Bommel <fvbommel wxs.nl>
parents:
1284
diff
changeset
|
20 |
875afb7a93b6
Factor out some constants into the header so producers and consumers of
Frits van Bommel <fvbommel wxs.nl>
parents:
1284
diff
changeset
|
21 // Must be kept last: |
875afb7a93b6
Factor out some constants into the header so producers and consumers of
Frits van Bommel <fvbommel wxs.nl>
parents:
1284
diff
changeset
|
22 TD_NumFields /// The number of fields in TypeInfo metadata |
875afb7a93b6
Factor out some constants into the header so producers and consumers of
Frits van Bommel <fvbommel wxs.nl>
parents:
1284
diff
changeset
|
23 }; |
875afb7a93b6
Factor out some constants into the header so producers and consumers of
Frits van Bommel <fvbommel wxs.nl>
parents:
1284
diff
changeset
|
24 |
1284
5851c18e4c6d
Add metadata for TypeInfo -> llvm::Type mapping.
Frits van Bommel <fvbommel wxs.nl>
parents:
diff
changeset
|
25 #endif |
5851c18e4c6d
Add metadata for TypeInfo -> llvm::Type mapping.
Frits van Bommel <fvbommel wxs.nl>
parents:
diff
changeset
|
26 |
5851c18e4c6d
Add metadata for TypeInfo -> llvm::Type mapping.
Frits van Bommel <fvbommel wxs.nl>
parents:
diff
changeset
|
27 #endif |