[PATCH] D113352: [clang] Run LLVM Verifier in modes without CodeGen too

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 7 23:24:21 PST 2021


rjmccall accepted this revision.
rjmccall added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:5016
   llvm::Constant *Resolver =
-      GetOrCreateLLVMFunction(IFA->getResolver(), ResolverTy, GD,
+      GetOrCreateLLVMFunction(IFA->getResolver(), ResolverTy, {},
                               /*ForVTable=*/false);
----------------
ibookstein wrote:
> rjmccall wrote:
> > Hmm, what was going on here?
> The `emitIFuncDefinition` fucntion incorrectly passes the GlobalDecl of the IFunc itself to the call to GetOrCreateLLVMFunction for creating the resolver, which causes it to be created with a wrong attribute list, which fails `Verifier::visitFunction` with "Attribute after last parameter!". You'll note that unlike the relationship between aliases and their aliasees, the resolver and the ifunc have different types - the resolver takes no parameters.
Okay.  I do wonder if there are attributes that we *should* take, but I agree that we probably shouldn't apply them by default; good catch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113352



More information about the cfe-commits mailing list