================
@@ -816,7 +816,7 @@ CGCallee ItaniumCXXABI::EmitLoadOfMemberFunctionPointer(
   // function pointer.
   CGF.EmitBlock(FnNonVirtual);
   llvm::Value *NonVirtualFn =
-      Builder.CreateIntToPtr(FnAsInt, CGF.UnqualPtrTy, "memptr.nonvirtualfn");
+      Builder.CreateIntToPtr(FnAsInt, CGF.DefaultPtrTy, "memptr.nonvirtualfn");
----------------
bjope wrote:

I guess this is an example when it gets a bit weird.

Downstream we actually have a special CGF.FnVoidPtrTy that is used here. As we 
want function pointers to use the ProgramAddressSpace from the DataLayout (the 
default address space for functions is not necessarily the same as for data). 
That is however not implemented in the upstream clang.

Using CGF.DefaultPtrTy here (being a pointer to the default data memory) seems 
a bit weird for Harvard Architectures when the program memory is different from 
the data memory.

So one could wonder if UnqualPtrTy was used here to denote that these function 
pointers should be treated as unqualified entities without having any address 
space associated with them (although then one could wonder how one know the 
size of the pointers)? Or at least to indicate that this is a pointer to 
possibly something else than just the default data address space.

(With that being said I'm thinking that maybe this refactoring is OK anyway, 
since it is only a kind of churn that rename things. Downstream we will have to 
deal with conflicts due to the fact that we actually identify function pointers 
a bit differently. Maybe that is something that we should consider upstreaming.)

https://github.com/llvm/llvm-project/pull/163207
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to