[PATCH] D91081: [flang] Avoid calling the linker when "-c" option is used

Pete Steinfeld via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 9 07:44:26 PST 2020


PeteSteinfeld created this revision.
PeteSteinfeld added a reviewer: sscalpone.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
PeteSteinfeld requested review of this revision.

The title says it all.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91081

Files:
  flang/tools/f18/f18.cpp


Index: flang/tools/f18/f18.cpp
===================================================================
--- flang/tools/f18/f18.cpp
+++ flang/tools/f18/f18.cpp
@@ -614,7 +614,8 @@
           << "\n"
           << "Defaults:\n"
           << "  When invoked with input files, and no options to tell\n"
-          << "  it otherwise, f18 will unparse its input and pass that on to an\n"
+          << "  it otherwise, f18 will unparse its input and pass that on to "
+             "an\n"
           << "  external compiler to continue the compilation.\n"
           << "  The external compiler is specified by the F18_FC environment\n"
           << "  variable. The default is 'gfortran'.\n"
@@ -652,7 +653,8 @@
           << "  -fget-symbols-sources\n"
           << "  -v -c -o -I -D -U    have their usual meanings\n"
           << "  -help                print this again\n"
-          << "Unrecognised options are passed through to the external compiler\n"
+          << "Unrecognised options are passed through to the external "
+             "compiler\n"
           << "set by F18_FC (see defaults).\n";
       return exitStatus;
     } else if (arg == "-V" || arg == "--version") {
@@ -721,7 +723,7 @@
       objlist.push_back(relo);
     }
   }
-  if (!objlist.empty()) {
+  if (!driver.compileOnly && !objlist.empty()) {
     Link(liblist, objlist, driver);
   }
   return exitStatus;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91081.303869.patch
Type: text/x-patch
Size: 1389 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201109/6640dc71/attachment.bin>


More information about the llvm-commits mailing list