Propagate types from symbol to aliases.
authorRafael Espindola <rafael.espindola@gmail.com>
Sun, 23 Mar 2014 03:33:20 +0000 (03:33 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Sun, 23 Mar 2014 03:33:20 +0000 (03:33 +0000)
commit4ff2dadebed5b428689bb6651b8f83688ce2d934
tree9263a7f487af3d16197e6e3ed5b1f2aeb590d3ff
parentc8ca83201c1d245f72b89bd07e79ec9b199cad8d
Propagate types from symbol to aliases.

This is similar, but not identical to what gas does. The logic in MC is to just
compute the symbol table after parsing the entire file. GAS is mixed, given

.type b, @object
a = b
b:
.type b, @function

It will propagate the change and make 'a' a function. Given

.type b, @object
b:
a = b
.type b, @function

the type of 'a' is still object.

Since we do the computation in the end, we produce a function in both cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204555 91177308-0d34-0410-b5e6-96231b3b80d8
lib/MC/ELFObjectWriter.cpp
test/MC/ELF/type-propagate.s [new file with mode: 0644]