[lld] registry design proposal
Nick Kledzik
kledzik at apple.com
Tue Dec 3 23:04:45 PST 2013
On Dec 3, 2013, at 10:45 PM, Michael Spencer wrote:
> On Tue, Dec 3, 2013 at 6:18 PM, Nick Kledzik <kledzik at apple.com> wrote:
>> There is a design pattern that solves all these problems. Have a global
>> registry of “handlers”. Require clients to call functions to which register
>> the handlers they request. Then any code that needs a handler calls the
>> global registry to call the needed handler.
>>
>> I see the need for three registries: a file parser registry, a yaml
>> document tag registry, and a kind string registry.
>
> What would the kind string registry look like? Is the intent for
> converting from Native -> YAML -> Native? I assume the namespace would
> just be {COFF, ELF, MachO}, <arch>.
It would replace the use of methods relocKindFromString() and stringFromRelocKind()
in LinkingContext. The native and yaml already have an "arch" field. They'll
both need a "kind namespace" (need a better word for that) field added.
-Nick
More information about the llvm-commits
mailing list