| Nick Kledzik | 7735a7d | 2012-01-04 23:58:17 +0000 | [diff] [blame] | 1 | //===- Core/YamlKeyValues.h - Reads YAML ----------------------------------===// |
| 2 | // |
| 3 | // The LLVM Linker |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef LLD_CORE_YAML_KEY_VALUES_H_ |
| 11 | #define LLD_CORE_YAML_KEY_VALUES_H_ |
| 12 | |
| 13 | #include "lld/Core/Atom.h" |
| Nick Kledzik | f4fb2c5 | 2012-01-11 01:06:19 +0000 | [diff] [blame] | 14 | #include "lld/Core/DefinedAtom.h" |
| Nick Kledzik | 6bc04c6 | 2012-02-22 21:56:59 +0000 | [diff] [blame] | 15 | #include "lld/Core/UndefinedAtom.h" |
| Nick Kledzik | 20e652d | 2012-04-20 01:24:37 +0000 | [diff] [blame^] | 16 | #include "lld/Core/File.h" |
| Nick Kledzik | 7735a7d | 2012-01-04 23:58:17 +0000 | [diff] [blame] | 17 | |
| 18 | |
| 19 | namespace lld { |
| 20 | namespace yaml { |
| 21 | |
| 22 | class KeyValues { |
| 23 | public: |
| Nick Kledzik | f4fb2c5 | 2012-01-11 01:06:19 +0000 | [diff] [blame] | 24 | static const char* const nameKeyword; |
| Nick Kledzik | 49d6cc8 | 2012-02-15 00:38:09 +0000 | [diff] [blame] | 25 | static const char* const refNameKeyword; |
| Nick Kledzik | f4fb2c5 | 2012-01-11 01:06:19 +0000 | [diff] [blame] | 26 | static const char* const sectionNameKeyword; |
| 27 | static const char* const contentKeyword; |
| 28 | static const char* const sizeKeyword; |
| Nick Kledzik | 6bc04c6 | 2012-02-22 21:56:59 +0000 | [diff] [blame] | 29 | static const char* const loadNameKeyword; |
| 30 | static const char* const valueKeyword; |
| Nick Kledzik | 49d6cc8 | 2012-02-15 00:38:09 +0000 | [diff] [blame] | 31 | static const char* const fixupsKeyword; |
| Nick Kledzik | 20e652d | 2012-04-20 01:24:37 +0000 | [diff] [blame^] | 32 | static const char* const fileAtomsKeyword; |
| 33 | static const char* const fileMembersKeyword; |
| 34 | |
| 35 | static const char* const fileKindKeyword; |
| 36 | static const File::Kind fileKindDefault; |
| 37 | static File::Kind fileKind(const char*); |
| 38 | static const char* fileKind(File::Kind); |
| Michael J. Spencer | 765792d | 2012-04-03 18:40:27 +0000 | [diff] [blame] | 39 | |
| Nick Kledzik | f4fb2c5 | 2012-01-11 01:06:19 +0000 | [diff] [blame] | 40 | static const char* const definitionKeyword; |
| 41 | static const Atom::Definition definitionDefault; |
| 42 | static Atom::Definition definition(const char*); |
| 43 | static const char* definition(Atom::Definition); |
| Nick Kledzik | 7735a7d | 2012-01-04 23:58:17 +0000 | [diff] [blame] | 44 | |
| Nick Kledzik | f4fb2c5 | 2012-01-11 01:06:19 +0000 | [diff] [blame] | 45 | static const char* const scopeKeyword; |
| 46 | static const DefinedAtom::Scope scopeDefault; |
| 47 | static DefinedAtom::Scope scope(const char*); |
| 48 | static const char* scope(DefinedAtom::Scope); |
| Michael J. Spencer | 765792d | 2012-04-03 18:40:27 +0000 | [diff] [blame] | 49 | |
| Nick Kledzik | f4fb2c5 | 2012-01-11 01:06:19 +0000 | [diff] [blame] | 50 | static const char* const contentTypeKeyword; |
| 51 | static const DefinedAtom::ContentType contentTypeDefault; |
| 52 | static DefinedAtom::ContentType contentType(const char*); |
| 53 | static const char* contentType(DefinedAtom::ContentType); |
| Nick Kledzik | 7735a7d | 2012-01-04 23:58:17 +0000 | [diff] [blame] | 54 | |
| Nick Kledzik | f4fb2c5 | 2012-01-11 01:06:19 +0000 | [diff] [blame] | 55 | static const char* const deadStripKindKeyword; |
| 56 | static const DefinedAtom::DeadStripKind deadStripKindDefault; |
| 57 | static DefinedAtom::DeadStripKind deadStripKind(const char*); |
| 58 | static const char* deadStripKind(DefinedAtom::DeadStripKind); |
| Nick Kledzik | 7735a7d | 2012-01-04 23:58:17 +0000 | [diff] [blame] | 59 | |
| Nick Kledzik | f4fb2c5 | 2012-01-11 01:06:19 +0000 | [diff] [blame] | 60 | static const char* const sectionChoiceKeyword; |
| 61 | static const DefinedAtom::SectionChoice sectionChoiceDefault; |
| 62 | static DefinedAtom::SectionChoice sectionChoice(const char*); |
| 63 | static const char* sectionChoice(DefinedAtom::SectionChoice); |
| Nick Kledzik | 7735a7d | 2012-01-04 23:58:17 +0000 | [diff] [blame] | 64 | |
| Nick Kledzik | f4fb2c5 | 2012-01-11 01:06:19 +0000 | [diff] [blame] | 65 | static const char* const interposableKeyword; |
| 66 | static const DefinedAtom::Interposable interposableDefault; |
| 67 | static DefinedAtom::Interposable interposable(const char*); |
| 68 | static const char* interposable(DefinedAtom::Interposable); |
| Nick Kledzik | 7735a7d | 2012-01-04 23:58:17 +0000 | [diff] [blame] | 69 | |
| Nick Kledzik | f4fb2c5 | 2012-01-11 01:06:19 +0000 | [diff] [blame] | 70 | static const char* const mergeKeyword; |
| 71 | static const DefinedAtom::Merge mergeDefault; |
| 72 | static DefinedAtom::Merge merge(const char*); |
| 73 | static const char* merge(DefinedAtom::Merge); |
| Nick Kledzik | 7735a7d | 2012-01-04 23:58:17 +0000 | [diff] [blame] | 74 | |
| Nick Kledzik | f4fb2c5 | 2012-01-11 01:06:19 +0000 | [diff] [blame] | 75 | static const char* const permissionsKeyword; |
| 76 | static const DefinedAtom::ContentPermissions permissionsDefault; |
| 77 | static DefinedAtom::ContentPermissions permissions(const char*); |
| 78 | static const char* permissions(DefinedAtom::ContentPermissions); |
| Nick Kledzik | 7735a7d | 2012-01-04 23:58:17 +0000 | [diff] [blame] | 79 | |
| Nick Kledzik | f4fb2c5 | 2012-01-11 01:06:19 +0000 | [diff] [blame] | 80 | static const char* const isThumbKeyword; |
| 81 | static const bool isThumbDefault; |
| 82 | static bool isThumb(const char*); |
| 83 | static const char* isThumb(bool); |
| Nick Kledzik | 7735a7d | 2012-01-04 23:58:17 +0000 | [diff] [blame] | 84 | |
| Nick Kledzik | f4fb2c5 | 2012-01-11 01:06:19 +0000 | [diff] [blame] | 85 | static const char* const isAliasKeyword; |
| 86 | static const bool isAliasDefault; |
| 87 | static bool isAlias(const char*); |
| 88 | static const char* isAlias(bool); |
| Nick Kledzik | 7735a7d | 2012-01-04 23:58:17 +0000 | [diff] [blame] | 89 | |
| Nick Kledzik | 6bc04c6 | 2012-02-22 21:56:59 +0000 | [diff] [blame] | 90 | static const char* const canBeNullKeyword; |
| 91 | static const UndefinedAtom::CanBeNull canBeNullDefault; |
| 92 | static UndefinedAtom::CanBeNull canBeNull(const char*); |
| 93 | static const char* canBeNull(UndefinedAtom::CanBeNull); |
| Nick Kledzik | 23384e8 | 2012-02-07 02:59:54 +0000 | [diff] [blame] | 94 | |
| Nick Kledzik | 49d6cc8 | 2012-02-15 00:38:09 +0000 | [diff] [blame] | 95 | |
| 96 | static const char* const fixupsKindKeyword; |
| 97 | static const char* const fixupsOffsetKeyword; |
| 98 | static const char* const fixupsTargetKeyword; |
| 99 | static const char* const fixupsAddendKeyword; |
| 100 | |
| Nick Kledzik | 7735a7d | 2012-01-04 23:58:17 +0000 | [diff] [blame] | 101 | }; |
| 102 | |
| 103 | } // namespace yaml |
| 104 | } // namespace lld |
| 105 | |
| 106 | #endif // LLD_CORE_YAML_KEY_VALUES_H_ |
| 107 | |