[PATCH] D100883: [flang][driver][revert] Revert f18 code so that options passed to -W does not not cause compilation termination.
Arnamoy B via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 20 13:06:43 PDT 2021
arnamoy10 created this revision.
arnamoy10 added reviewers: awarzynski, kiranchandramohan, SouraVX.
arnamoy10 added projects: Flang, OpenMP.
Herald added a subscriber: jdoerfert.
Herald added a reviewer: sscalpone.
arnamoy10 requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: llvm-commits, sstefan1.
Herald added a project: LLVM.
`f18` runs compilation all the way to the linking step. However, with the implementation of the `-Werror` option in the frontend driver, to makes tests shareable between the driver and `f18`, the code of the later was modified so that it terminates compilation if anything other than `error` is given for `-W`.
So a command like the following would fail:
flang -Wl,-z,muldefs -march=skylake-avx512 -mfpmath=sse -Ofast -funroll-loops -flto exchange2.fppized.o -L/export/users/yanguanw/build_1.1.1/jemalloc/intel64/lib/ -ljemalloc -o exchange2_r
This patch takes away the modification ONLY in `f18`, so that the driver still retains the power to cause compilation termination if anything other that `-Werror` is supplied for the `-W` option (until they are supported).
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D100883
Files:
flang/test/Driver/werror-wrong.f90
flang/tools/f18/f18.cpp
Index: flang/tools/f18/f18.cpp
===================================================================
--- flang/tools/f18/f18.cpp
+++ flang/tools/f18/f18.cpp
@@ -514,11 +514,6 @@
} else if (arg.find("-W") != std::string::npos) {
if (arg == "-Werror")
driver.warningsAreErrors = true;
- else {
- // Only -Werror is supported currently
- llvm::errs() << "Only `-Werror` is supported currently.\n";
- return EXIT_FAILURE;
- }
} else if (arg == "-ed") {
options.features.Enable(Fortran::common::LanguageFeature::OldDebugLines);
} else if (arg == "-E") {
Index: flang/test/Driver/werror-wrong.f90
===================================================================
--- flang/test/Driver/werror-wrong.f90
+++ flang/test/Driver/werror-wrong.f90
@@ -1,4 +1,5 @@
! Ensure that only argument -Werror is supported.
+! REQUIRES: new-flang-driver
! RUN: not %flang_fc1 -fsyntax-only -Wall %s 2>&1 | FileCheck %s --check-prefix=WRONG
! RUN: not %flang_fc1 -fsyntax-only -WX %s 2>&1 | FileCheck %s --check-prefix=WRONG
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100883.338970.patch
Type: text/x-patch
Size: 1077 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210420/0e48c934/attachment.bin>
More information about the llvm-commits
mailing list