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

Ruiling, Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 18 12:58:59 PST 2020


ruiling added inline comments.


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


================
Comment at: llvm/unittests/Transforms/Utils/CloningTest.cpp:846
+                                  GlobalValue::ExternalLinkage, nullptr, "gvd");
+    GVD->addMetadata(LLVMContext::MD_type, *MDNode::get(C, {}));
+
----------------
aprantl wrote:
> 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?
the GVD is just a global variable declaration, which means have no initializer. will document it to make is obvious.


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