awarzynski added inline comments.

================
Comment at: flang/lib/Frontend/FrontendActions.cpp:87
+      defaultKinds, features, ci.allCookedSources()};
+  semanticsContext.set_moduleDirectory("."s);
+  Fortran::semantics::Semantics semantics{
----------------
CarolineConcatto wrote:
> Just a quick question:
> Why you cannot use this function:
> CompilerInvocation::SetDefaultFortranOpts
> instead of using  semanticsContext.set_moduleDirectory("."s);
> ?
Hard-coded values are bad, thanks for pointing that out!

We can't use `CompilerInvocation::SetDefaultFortranOpts` here, as that's for 
`Fortran::parser::Options`, and here we are dealing with the internal state of 
`Fortran::semantics::SemanticsContext`. 

However, `moduleDirectory_` is in fact initialised to `"."s` by default: 
https://github.com/llvm/llvm-project/blob/8acb5f2723ecaf0f1904a085ad79d0623cec38f6/flang/include/flang/Semantics/semantics.h#L185.
 

So, it's safe to delete this line for now. A proper solution/approach will be 
implemented once we add support for `-module-dir`: 
https://docs.google.com/spreadsheets/d/1JRe39lP_KhtkYxFEIvwrCFlE5v1Ofa_krOHI-XXXWPY/edit#gid=0.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92854

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to