[PATCH] D129033: [Clang] Use metadata to make identifying embedded objects easier

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 7 08:01:46 PDT 2022


jdoerfert added a comment.

Generally makes sense, some notes though



================
Comment at: clang/test/Frontend/embed-object.ll:17
+
+; CHECK: !llvm.embedded.object = !{![[METADATA_1:[0-9]+]], ![[METADATA_2:[0-9]+]]}
+; CHECK: ![[METADATA_1]] = !{ptr @[[OBJECT_1]], !".llvm.offloading"}
----------------
shouldn't it be objects?

The metadata should be defined somewhere (lang ref?)


================
Comment at: clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp:371
+  // `llvm.embedded.object` metadata with the `.llvm.offloading` section.
+  auto MD = M->getNamedMetadata("llvm.embedded.object");
+  for (const MDNode *Op : MD->operands()) {
----------------
Handle nullptr


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129033



More information about the cfe-commits mailing list