ahatanak marked 2 inline comments as done.
ahatanak added inline comments.

================
Comment at: lib/CodeGen/CGObjCMac.cpp:3961
+  // linkage so that the linker preserves the symbol name.
+  llvm::GlobalValue::LinkageTypes LT =
+      Section.empty() || Section.startswith("__DATA")
----------------
compnerd wrote:
> Hmm, when would you have a metadata variable not in the `__DATA` segment?
There are several places where a section string that starts with `__OBJC` is 
passed. For example, `CGObjCMac::EmitModuleSymbols`.


================
Comment at: lib/CodeGen/CGObjCMac.cpp:7266
+                                     false,
+                                     CGM.getTriple().isOSBinFormatMachO()
+                                         ? llvm::GlobalValue::InternalLinkage
----------------
compnerd wrote:
> Is there a reason to not make this and the other instances `Internal` 
> irrespective of the object file format?
When the object file format isn't MachO, this variable doesn't go into a 
section that is in `__DATA`, so we want to keep the variable private to avoid 
needlessly preserving the symbol name.

The intent of the patch is to prevent the linker from removing the symbol names 
of symbols in `__DATA` so that tools can collect information about those 
symbols.


Repository:
  rC Clang

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

https://reviews.llvm.org/D61454



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to