Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lld/wasm/Relocations.cpp | ||
---|---|---|
45 | Actually there was a recent refactor that made importName a (optional) member of the Symbol superclass.. so I think this can be written as: if (sym->importName) return true; if (isa<UndefinedFunction>(sym) && config->importUndefined) return true; But if you would rather land this as is that is fine too. |
lld/wasm/Relocations.cpp | ||
---|---|---|
45 |
Isn't this || in the current code? Also, if we return true unconditionally when sym->importName is defined, I think we return true for data or tables. Is that what you intended? |
we return true uncondition
lld/wasm/Relocations.cpp | ||
---|---|---|
45 | Yes, any symbol with an explicit importName should always be imported and never have "undefined symbol" reported about it. |
lld/wasm/Relocations.cpp | ||
---|---|---|
45 | Which one is correct? if (isa<UndefinedFunction>(sym) && config->importUndefined) vs. if (isa<UndefinedFunction>(sym) || config->importUndefined) (The current code is like the latter and you suggested the former) Also, config->importUndefined doesn't affect UndefinedGlobal, or UndefinedTag I am going to add? |
lld/wasm/Relocations.cpp | ||
---|---|---|
45 | I think we should leave importUndefined as only effecting functions symbols for now. We could followup by extending it but that would not be NFC. Thus I think the if (isa<UndefinedFunction>(sym) && config->importUndefined) matches the original semantics and is that we should do here for now. |
lld/wasm/Relocations.cpp | ||
---|---|---|
45 |
if (sym->importName) return true; But doesn't this affect not only functions but all symbols?
The current code already handles globals, even twice, one of which I removed. So if we make this only handle functions that will not be NFC instead.. No? |
lld/wasm/Relocations.cpp | ||
---|---|---|
45 | Ah, sorry, I misread your comment. Nevermind the comment above. I can't believe you can't delete comments from Phabricator... |
lld/wasm/Relocations.cpp | ||
---|---|---|
34–35 | Now that this function does not specifically target globals, is this comment correct? Can data or tables have explicit import names and return true here? |
lld/wasm/Relocations.cpp | ||
---|---|---|
34–35 | Yes, anything that has an explicit import name should return true here. I guess we don't do much testing for those cases because the use of tables outsides of the singleton __indirect_function_table is still basically non-existent. |
lld/wasm/Relocations.cpp | ||
---|---|---|
34–35 | Maybe change the comment too: // Symbols with explicit import names are always allowed to be undefined at link time. |
Now that this function does not specifically target globals, is this comment correct? Can data or tables have explicit import names and return true here?