[llvm-commits] [lto][patch] Remove weak attempt of tracking symbols defined in module level assembly

Rafael Ávila de Espíndola rafael.espindola at gmail.com
Sat Feb 19 15:14:06 PST 2011


I noticed that when given a module with

module asm "\09.if\093 < 10"
module asm "\09.globl\09_ZN14nsXPTCStubBase5Stub3Ev"
module asm "\09.endif"

libLTO would report a symbol whose name started with a tab. I was
surprised that a symbol was reported at all.

Looking in the libLTO source code shows that it has a very basic support
for trying to guess what symbols are defined in an inline assembly. It
does a series of searches for ".globl"!

IMHO weak heuristics like this cause more harm than good. LLVM should
not understand the assembly string or it should use MC to represent the
assembly code in a parsed form. In any case, the logic should not be in
libLTO :-)

The attached patch removes the current heuristic.

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: noasm.patch
Type: text/x-patch
Size: 2654 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110219/e9c51acc/attachment.bin>


More information about the llvm-commits mailing list