Make the LTO comdat api more symbol table friendly.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 25 Oct 2016 12:02:03 +0000 (12:02 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 25 Oct 2016 12:02:03 +0000 (12:02 +0000)
commit7912110ddc368f932d20bc82a951371bf9d48ae9
treeacfa388a9c1ac9a76623df75c0427bde655bb174
parent63c6989d70ed1f94fc6a2a074fe703730e0a00a8
Make the LTO comdat api more symbol table friendly.

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> getComdatTable() const;

Symbol:
int getComdatIndex() 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.

llvm-svn: 285061
llvm/include/llvm/LTO/LTO.h
llvm/lib/LTO/LTO.cpp
llvm/tools/gold/gold-plugin.cpp