[clang] [llvm] [clang][LTO] Emit symbols for global inline assembly as module flags (PR #174995)

Andrew Savonichev via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 28 06:40:16 PST 2026


================
@@ -187,13 +161,174 @@ void ModuleSymbolTable::CollectAsmSymbols(
   }
 }
 
+static void
+addSymbols(RecordStreamer &Streamer,
+           function_ref<void(StringRef, BasicSymbolRef::Flags)> AsmSymbol) {
+  Streamer.flushSymverDirectives();
+
+  for (const auto &[Name, State] : Streamer) {
+    // FIXME: For now we just assume that all asm symbols are executable.
+    uint32_t Res = BasicSymbolRef::SF_Executable;
----------------
asavonic wrote:

In general case we may not be able to distinguish functions from global variables, I think.
There are STT_FUNC and STT_OBJECT in ELF, but they are not processed in `RecordStreamer`. They are also not present in `BasicSymbolRef::Flags` bitmask that we use for elements of `global-asm-symbols`.

https://github.com/llvm/llvm-project/pull/174995


More information about the llvm-commits mailing list