rjmccall accepted this revision.
rjmccall added a comment.

LGTM, thanks!



================
Comment at: clang/test/CodeGen/avr/functionptr-addrspace.c:3
+
+int main() {
+  int (*p)();
----------------
eandrews wrote:
> When writing the test I noticed an existing crash in the compiler. I am not 
> sure if I am doing something wrong but if you try to assign to the pointer, 
> you will hit the following assert - 
> https://llvm.org/doxygen/Constants_8cpp_source.html#l02280
> 
> ```
> int f() { return 0; }
> 
> int main() {
>   int (*p)() = f;
>   return 0;
> }
> ```
> 
> I briefly debugged this and I think the crash is because in 
> `GetAddrOfFunction` we call `ConvertType` which returns type without the 
> address space here - 
> https://clang.llvm.org/doxygen/CodeGenTypes_8cpp_source.html#l00419.
> 
> I didn't fix this or debug this further since it is outside the scope of this 
> patch but I can look into it as a followup PR
Okay.  AVR may be a constrained enough environment that they don't actually run 
into this sort of thing, but yeah, it'd be great to chase these bugs down.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111566/new/

https://reviews.llvm.org/D111566

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to