[clang] [clang][CGOpenMPRuntime] Avoid Type::getPointerTo() (NFC) (PR #112017)

Nikita Popov via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 11 09:52:22 PDT 2024


================
@@ -1713,25 +1713,15 @@ llvm::Function *CGOpenMPRuntime::emitThreadPrivateVarDefinition(
     if (!Ctor && !Dtor)
       return nullptr;
 
-    llvm::Type *CopyCtorTyArgs[] = {CGM.VoidPtrTy, CGM.VoidPtrTy};
-    auto *CopyCtorTy = llvm::FunctionType::get(CGM.VoidPtrTy, CopyCtorTyArgs,
-                                               /*isVarArg=*/false)
-                           ->getPointerTo();
     // Copying constructor for the threadprivate variable.
     // Must be NULL - reserved by runtime, but currently it requires that this
     // parameter is always NULL. Otherwise it fires assertion.
-    CopyCtor = llvm::Constant::getNullValue(CopyCtorTy);
+    CopyCtor = llvm::Constant::getNullValue(CGM.VoidPtrTy);
----------------
nikic wrote:

```suggestion
    CopyCtor = llvm::Constant::getNullValue(CGM.UnqualPtrTy);
```
I don't think we should use VoidPtrTy if it's not supposed to represent a `void *`.

https://github.com/llvm/llvm-project/pull/112017


More information about the cfe-commits mailing list