[PATCH] D97080: [flang][driver] Add -fintrinsic-modules-path option
Arnamoy B via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 19 08:29:16 PDT 2021
arnamoy10 added inline comments.
================
Comment at: flang/lib/Frontend/CompilerInvocation.cpp:292
+ std::string driverPath = llvm::sys::fs::getMainExecutable(nullptr, nullptr);
+ driverPath = driverPath.substr(0, driverPath.size() - 9);
+ return driverPath.append("/../include/flang/");
----------------
awarzynski wrote:
> arnamoy10 wrote:
> > bryanpkc wrote:
> > > Can you use `llvm::sys::path::remove_filename` here?
> > Thank you. This seems like a better option, but I could not make it work. For the sake of time I am keeping this hard coded manipulation. It can be improved in a later revision.
> It would be really nice to use `llvm::sys::path::remove_filename` instead. Perhaps something like this:
> ```
> llvm::SmallString<128> driverPath;
> driverPath.assign(llvm::sys::fs::getMainExecutable(nullptr, nullptr));
> llvm::sys::path::remove_filename(driverPath);
> ```
> ?
This works, thanks for the code!
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97080/new/
https://reviews.llvm.org/D97080
More information about the cfe-commits
mailing list