[PATCH] D152391: [Clang] Allow bitcode linking when the input is LLVM-IR

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 13 08:08:04 PDT 2023


yaxunl added inline comments.


================
Comment at: clang/lib/CodeGen/CGCall.cpp:2052-2106
+void clang::CodeGen::mergeDefaultFunctionDefinitionAttributes(
+    llvm::Function &F, const CodeGenOptions CodeGenOpts,
+    const LangOptions &LangOpts, const TargetOptions &TargetOpts,
+    bool WillInternalize) {
+
+  llvm::AttrBuilder FuncAttrs(F.getContext());
+  if (!TargetOpts.CPU.empty())
----------------
can we reorder these functions to minimize the diffs? Also some comments about the difference among these functions may help.


================
Comment at: clang/lib/CodeGen/CodeGenAction.cpp:266
     // Links each entry in LinkModules into our module.  Returns true on error.
-    bool LinkInModules() {
+    bool LinkInModules(llvm::Module *M = nullptr) {
       for (auto &LM : LinkModules) {
----------------
Removing the default argument may make the code clearer


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152391



More information about the cfe-commits mailing list