[PATCH] D97080: [flang][driver] Add -fintrinsic-modules-path option

Andrzej Warzynski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 22 09:44:04 PST 2021


awarzynski requested changes to this revision.
awarzynski added a comment.
This revision now requires changes to proceed.

Hi @arnamoy10 , thanks for the patch!

Both `ieee_arithmetic.mod` and `iso_fortran_env.mod` look like copies of similar files from `<build-dir>/tools/flang/include/flang`. Could you either re-use those or add something custom?



================
Comment at: clang/include/clang/Driver/Options.td:4273
+def fintrinsic_modules_path : Separate<["-"], "fintrinsic-modules-path">,  Group<f_Group>, MetaVarName<"<dir>">,
+  HelpText<"Specify the location of pre-compiled intrinsic modules.">,
+  DocBrief<[{This option specifies the location of pre-compiled intrinsic modules, 
----------------
Why not copy this from `gfortran`?
```
$ gfortran --help=separate | grep intrinsic
  -fintrinsic-modules-path    Specify where to find the compiled intrinsic modules.
```


================
Comment at: flang/include/flang/Frontend/PreprocessorOptions.h:32
   // as there is no point creating a class for just one field.
-  std::vector<std::string> searchDirectoriesFromDashI;
+  std::vector<std::string> searchDirectories;
 
----------------
As `-I` and `-fintrinsic-modules-path` are 2 different options, I would prefer to preserve that separation and model it within the driver with 2 separate vars, e.g.:
```
std::vector<std::string> searchDirectoriesFromDashI;
std::vector<std::string> searchDirectoriesFromIntrModPath;
```


================
Comment at: flang/include/flang/Frontend/PreprocessorOptions.h:48
-#endif // LLVM_FLANG_PREPROCESSOROPTIONS_H
\ No newline at end of file
+#endif // LLVM_FLANG_PREPROCESSOROPTIONS_H

----------------
Thank you :)


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

https://reviews.llvm.org/D97080



More information about the cfe-commits mailing list