mgorny added inline comments.
Herald added subscribers: jdoerfert, krytarowski.


================
Comment at: lib/Driver/ToolChains/DragonFly.cpp:118
     }
-    
CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath("crti.o")));
-    if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_pie))
-      CmdArgs.push_back(
-          Args.MakeArgString(getToolChain().GetFilePath("crtbeginS.o")));
+    if (crt1)
+      CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crt1)));
----------------
Can't `crt1` be non-null only if `!Args.hasArg(options::OPT_shared` here? i.e. 
is there a reason to do it like this instead of just pushing it inside the 
above `if`?


================
Comment at: lib/Driver/ToolChains/DragonFly.cpp:123
+
+    const char *crtbegin = nullptr;
+    if (Args.hasArg(options::OPT_shared) || IsPIE)
----------------
This default will never be used.


================
Comment at: lib/Driver/ToolChains/DragonFly.cpp:185
+    if (Args.hasArg(options::OPT_shared) || IsPIE)
+      
CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtendS.o")));
     else
----------------
Inconsistency here: above you used helper variable, here you duplicate the 
whole line.


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

https://reviews.llvm.org/D35169



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D35169: Refactor Dr... Michał Górny via Phabricator via cfe-commits

Reply via email to