It's not much use yet, but getting the constants into the headers and adding some stub support enables at least LLD to be tested against defined & undefined globals.
Comes after D42495. Doesn't break LLD.
Differential D42752
[WebAssembly] Add LLVM stub support for defined globals ncw on Jan 31 2018, 11:18 AM. Authored by
Details
Diff Detail
Event Timeline
Comment Actions Abandoning; COMDAT for globals would be nice (for completeness) but isn't important now - no need to fight for it currently. I still think it should probably be added to Linking.md before the first formally-complete release, but I agree it's not important. |
Not really needed for anything -yet :)
I wanted to add the COMDAT_GLOBAL enum value to the header, and implement it in LLD - otherwise the LLD code just looks "lopsided". And moreover we can test it in LLD.
So having put the COMDAT_GLOBAL enum value in place, it needs supporting in obj2yaml etc... And all that code can be tested.
This chunk of code here where we handle defined global MCSymbolWasms is the only bit of truly "dead" code. It's just five lines of fairly sensible filler code, here to save somebody else some time later when they actually come to make use of global syms. If someone wants to add support in the frontend, now they won't need to worry about how to feed the globals into the object file, because it's handled here already.
We'll need a compiler intrinsic quite soon to declare/read/write globals, as something to use for implementing thread-local storage.