Reducing confusion around isUndefined()

(switching list from llvm-commits to llvm-dev, which seems more appropriate here)

Shoaib Meenai <smeenai@fb.com> writes:

(switching list from llvm-commits to llvm-dev, which seems more appropriate here)

Thanks.

I think I'm not too excited about adding more predicates or inheritance. Lazy symbols are useful only when we are adding files to the symbol table. After that, there's no use of them. So maybe we can just visit all symbols at some point after reading all files but before writeResult to nuke all Lazy symbols (by replacing local undefined symbol or something), so that we don't have to think about it after that point.

True. We should be able to either remove or convert to undef every lazy
symbol after we read all the files.

Cheers,
Rafael

I ran into this a couple of months ago, when doing something else, but was too caught up in that so didn’t get around to raising it. I agree that converting the symbols from lazy after we’re done with them makes sense. It would also allow us to simplify a number of places where we check for !Lazy && !Undefined or similar.