[lld] lld: add support for NOCROSSREFS(_TO) (PR #95714)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 17 11:01:11 PDT 2024


================
@@ -279,6 +295,10 @@ void ScriptParser::readLinkerScript() {
       readTarget();
     } else if (tok == "VERSION") {
       readVersion();
+    } else if (tok == "NOCROSSREFS") {
+      readNoCrossRefs();
+    } else if (tok == "NOCROSSREFS_TO") {
+      readNoCrossRefs(true);
----------------
smithp35 wrote:

This is subjective, and please ignore if MaskRay disagrees.

could you put a comment before the true with the parameter name /* to */ there's a few functions in the file that follow this convention.

In this case it is probably obvious what the true is referring to, but adding the comment is still worth doing.

It could also be worth using /*to*/ false and removing the default parameter.

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


More information about the llvm-commits mailing list