[clang] [clang-linker-wrapper] Re-use type returned from 'PointerType::getUnqual(C)' (NFC) (PR #73374)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 24 15:20:05 PST 2023


================
@@ -457,45 +457,42 @@ void createRegisterFatbinFunction(Module &M, GlobalVariable *FatbinDesc,
                        IsHIP ? ".hip.fatbin_unreg" : ".cuda.fatbin_unreg", &M);
   DtorFunc->setSection(".text.startup");
 
+  auto *PtrTy = PointerType::getUnqual(C);
+
   // Get the __cudaRegisterFatBinary function declaration.
-  auto *RegFatTy = FunctionType::get(PointerType::getUnqual(C)->getPointerTo(),
-                                     PointerType::getUnqual(C),
-                                     /*isVarArg*/ false);
+  auto *RegFatTy = FunctionType::get(PtrTy, PtrTy,
+                                     /*isVarArg=*/ false);
----------------
jhuber6 wrote:

Shouldn't clang-format remove the whitespace here? Figure it would come out looking like this but I think it's sometimes weird handling these types of arguments.
```suggestion
  auto *RegFatTy = FunctionType::get(PtrTy, PtrTy, /*isVarArg=*/false);
```

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


More information about the cfe-commits mailing list