[clang] b699e8b - Add another assert to cpu-dispatch emission to help track down a tough

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 13 06:54:13 PST 2022


Author: Erich Keane
Date: 2022-01-13T06:54:08-08:00
New Revision: b699e8b11aa92ca4fcade2616d4a4bbc1d3a717e

URL: https://github.com/llvm/llvm-project/commit/b699e8b11aa92ca4fcade2616d4a4bbc1d3a717e
DIFF: https://github.com/llvm/llvm-project/commit/b699e8b11aa92ca4fcade2616d4a4bbc1d3a717e.diff

LOG: 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.

Added: 
    

Modified: 
    clang/lib/CodeGen/CodeGenModule.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index d824cb3980506..42dfce32ed131 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<FunctionDecl>(GD.getDecl());
   assert(FD && "Not a FunctionDecl?");
+  assert(FD->isCPUDispatchMultiVersion() && "Not a multiversion function?");
   const auto *DD = FD->getAttr<CPUDispatchAttr>();
   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;


        


More information about the cfe-commits mailing list