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

Chris Lattner clattner at apple.com
Sat Feb 19 15:39:02 PST 2011


On Feb 19, 2011, at 3:14 PM, Rafael Ávila de Espíndola wrote:

> 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 :-)

I agree that the heuristic is a gross hack, but this will break building llvm itself with LTO, since the JIT defines a symbol (for the compilation callback) in file scope inline asm.

I think that the right longer term answer is to use the MC parser with a custom mcstreamer to pick out symbol definitions.

-Chris



More information about the llvm-commits mailing list