From: Erich Keane Date: Thu, 13 Jan 2022 14:52:58 +0000 (-0800) Subject: Add another assert to cpu-dispatch emission to help track down a tough X-Git-Tag: upstream/15.0.7~20631 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b699e8b11aa92ca4fcade2616d4a4bbc1d3a717e;p=platform%2Fupstream%2Fllvm.git Add another assert to cpu-dispatch emission to help track down a tough to repro error. As mentioned yesterday, I've got a problem that I can only reproduce on Godbolt (none of the build configs on my local machine!), so this is at least somewhat usable until I figure out a cause. --- diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index d824cb3..42dfce3 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -3479,6 +3479,7 @@ void CodeGenModule::emitMultiVersionFunctions() { void CodeGenModule::emitCPUDispatchDefinition(GlobalDecl GD) { const auto *FD = cast(GD.getDecl()); assert(FD && "Not a FunctionDecl?"); + assert(FD->isCPUDispatchMultiVersion() && "Not a multiversion function?"); const auto *DD = FD->getAttr(); assert(DD && "Not a cpu_dispatch Function?"); llvm::Type *DeclTy = getTypes().ConvertType(FD->getType()); @@ -3498,7 +3499,7 @@ void CodeGenModule::emitCPUDispatchDefinition(GlobalDecl GD) { Context.getTargetAddressSpace(FD->getType())), false); assert(ResolverName.endswith(".resolver") && - "CPUDispatch IFunc resolver doesn't end with .resolver?"); + "CPUDispatch IFunc resolver doesn't end with .resolver??"); } else { ResolverType = DeclTy;