[PATCH] D116542: [OpenMP] Add a flag for embedding a file into the module

Jon Chesterfield via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 31 06:52:20 PST 2022


JonChesterfield added inline comments.


================
Comment at: clang/lib/CodeGen/BackendUtil.cpp:1760
+  for (StringRef OffloadObject : CGOpts.OffloadObjects) {
+    auto FilenameAndSection = OffloadObject.split(',');
+    llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> ObjectOrErr =
----------------
JonChesterfield wrote:
> Could we have a type here instead of auto? I'm trying to guess what a StringRef split might return and there seems to be a few choices. If it's a container of some sort we could error on size() != 2
Nvm, it's a pair.

We could add
```if (OffloadObject.count(',') !=1 )  {
    Diags.Report(DiagID) << OffloadObject;
   return;
}```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116542



More information about the cfe-commits mailing list