[PATCH] D100076: [lld-macho] Support -add_ast_path

Greg Clayton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 7 19:23:54 PDT 2021


clayborg added a comment.

The N_AST symbol is used to specify a file on disk that contains the one and only Swift AST blob. This blob of data will be given back to the Swift compiler that is built into LLDB. I don't think this can be specified multiple times. Inline comments ask if



================
Comment at: lld/MachO/Options.td:539-542
+def add_ast_path : Separate<["-"], "add_ast_path">,
+    MetaVarName<"<path>">,
+    HelpText<"AST paths will be emitted as STABS">,
+    Group<grp_symtab>;
----------------
Does this allow specifying this option more than once? I don't believe this is supported as there should only be one N_AST.


================
Comment at: lld/MachO/SyntheticSections.cpp:683
 void SymtabSection::emitStabs() {
+  for (const std::string &s : config->astPaths) {
+    StabsEntry astStab(N_AST);
----------------
I don't think we can have more than one N_AST values emitted. Does ld64 supports multiple?


================
Comment at: lld/MachO/SyntheticSections.cpp:685
+    StabsEntry astStab(N_AST);
+    astStab.strx = stringTableSection.addString(s);
+    stabs.emplace_back(std::move(astStab));
----------------
Does ld64 put the mod time of the AST file in the symbol table value? I can't remember, but it would be worth checking


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100076/new/

https://reviews.llvm.org/D100076



More information about the llvm-commits mailing list