[PATCH] D96344: [flang][driver] Add options for -fdefault* and -flarge-sizes

Andrzej Warzynski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 15 03:37:03 PST 2021


awarzynski added a comment.

LGTM, thank you for working on this @arnamoy10 !

I left a few _minor_ comments. These can be addressed in the actual commit.



================
Comment at: clang/include/clang/Driver/Options.td:4224-4231
+def fdefault_double_8 : Flag<["-"],"fdefault-double-8">, Group<f_Group>, Flags<[FlangOption,FC1Option,FlangOnlyOption]>,
+  HelpText<"Set the DOUBLE PRECISION type and double real constants like 1.d0 to an 8 byte wide type.">;
+def fdefault_integer_8 : Flag<["-"],"fdefault-integer-8">, Group<f_Group>, Flags<[FlangOption,FC1Option,FlangOnlyOption]>,
+  HelpText<"Set the default integer and logical types to an 8 byte wide type.">;
+def fdefault_real_8 : Flag<["-"],"fdefault-real-8">, Group<f_Group>, Flags<[FlangOption,FC1Option,FlangOnlyOption]>,
+  HelpText<"Set the default real type to an 8 byte wide type.">;
+def flarge_sizes : Flag<["-"],"flarge-sizes">, Group<f_Group>, Flags<[FlangOption,FC1Option,FlangOnlyOption]>,
----------------
As these options are defined within this `let` statement:
```
let Flags = [FC1Option, FlangOption, FlangOnlyOption] in {

}
```
there is no need to specify `Flags` independently for each.


================
Comment at: flang/include/flang/Frontend/CompilerInvocation.h:80-81
+  // Fortran Dialect options
+  std::unique_ptr<Fortran::common::IntrinsicTypeDefaultKinds> defaultKinds_;
+  Fortran::frontend::DialectOptions dialectOpts_;
+
----------------
awarzynski wrote:
> Wouldn't it be possible to just use `defaultKinds_` here rather than `defaultKinds_` _and_ `dialectOpts_`? Do you think that we will need both?
Thank you for updating this.

One additional point - I would be tempted to use a regular member variable here rather than a pointer. I suspect that you were inspired by `semanticContext_`? Currently we have to use a pointer for `semanticsContext_` as we can't use the default constructor for `SemanticsContext` (it requires arguments that we don't have access to at the point of constructing `CompilerInvocation`). That's not the case for `IntrinsicTypeDefaultKinds`.

But I might missing something here!


================
Comment at: flang/test/Flang-Driver/driver-help.f90:31
 ! HELP-NEXT: -ffixed-line-length=<value>
-! HELP-NEXT: Use <value> as character line width in fixed mode
+! HELP-NEXT:  Use <value> as character line width in fixed mode
 ! HELP-NEXT: -ffree-form            Process source files in free form
----------------
[nit] Unrelated change


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

https://reviews.llvm.org/D96344



More information about the cfe-commits mailing list