jyknight wrote: The best answer for this problem is to stop parsing global module assembly during what's supposed to be a simple iteration of an IR module symbol table. This we do so is, and always was, an extremely unfortunate hack. (It's pretty crazy that "llvm-nm foo.bc" invokes the asm-parser, for example!)
Sadly, we must parse the asm _somewhere_ to extract the list of defined symbols, given that: 1. We do need to know which symbols a module-global asm defines. 2. The GNU C global-asm syntax doesn't require users to specify this (ideally, it should). I have suggested in the past that we modify LLVM IR to require emitting a new special kind of IR-level symbol definition stanza for any symbol that is supposed to be defined in asm. Then, the Clang frontend would be responsible for invoking the asm parser to extract the list of defined symbols from module-global asm, and emit these IR definitions. I still think this would be a good idea, but someone needs to actually implement it. https://github.com/llvm/llvm-project/pull/167439 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
