[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 09:38:01 PDT 2023


yaxunl added inline comments.


================
Comment at: clang/lib/CodeGen/CGCall.cpp:2105-2106
+  llvm::AttrBuilder FuncAttrs(F.getContext());
+  GetCPUAndFeaturesAttributes(GlobalDecl(), FuncAttrs,
+                              /*AddTargetFeatures=*/false);
+
----------------
jhuber6 wrote:
> yaxunl wrote:
> > should this be removed? seems redundant
> I wasn't entirely sure, there's a lot of work done in that function but pretty much all of it goes away since we just use `GlobalDecl()`. So for the version that doesn't have access to CGM I copies out the only two relevant lines and put them in line 2063. We could probably make this use the same code but I wasn't sure if there was something else we might need it for.
I tend to think they are equivalent. If GetCPUAndFeaturesAttributes did something else, it may be overwritten by the counterparts in mergeDefaultFunctionDefinitionAttributes.


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