In an IR symbol table I would expect the comdats to be represented as:
- A table of strings, one for each comdat name.
- Each symbol has an optional index into that table.
The natural api for accessing that would be
InputFile:
ArrayRef<StringRef> getComdats() const;
Symbol:
int getComdat() const;
This patch implements an API as close to that as possible. The implementation on top of the current IRObjectFile is a bit hackish, but should map just fine over a symbol table and is very convenient to use (I will upload the lld patch).
Uh, this is not ideal. Hopefully we can get rid of it once we migrate to a bitcode symtab.