[PATCH] D93451: [Cloning] Copy metadata of global declarations

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 18 09:11:34 PST 2020


aprantl added inline comments.


================
Comment at: llvm/unittests/Transforms/Utils/CloningTest.cpp:843
 
+    // global declare
+    auto GVD = new GlobalVariable(*OldM, Type::getInt32Ty(C), false,
----------------
Nit: LLVM coding style wants full sentences in comments.
i.e.: `// Test global variable declarations.`


================
Comment at: llvm/unittests/Transforms/Utils/CloningTest.cpp:846
+                                  GlobalValue::ExternalLinkage, nullptr, "gvd");
+    GVD->addMetadata(LLVMContext::MD_type, *MDNode::get(C, {}));
+
----------------
It's not obvious to me what the intended difference between GVD and GV is — is it just the Comdat flag? Could we document that?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93451



More information about the llvm-commits mailing list