[AVR] Use the correct address space for non-prototyped function calls
authorAyke van Laethem <aykevanlaethem@gmail.com>
Tue, 14 Apr 2020 16:13:41 +0000 (18:13 +0200)
committerAyke van Laethem <aykevanlaethem@gmail.com>
Wed, 15 Apr 2020 21:44:51 +0000 (23:44 +0200)
commit215dc2e203341f7d1edc4c4a191b048af4ace43d
tree27211a35fc29de380e8abd03b5b18e9a2f447a97
parent5e04b5f2fa84a65ecf37b9aa2c014493232793b0
[AVR] Use the correct address space for non-prototyped function calls

Some function declarations like this:

    void foo();

do not have a type declaration, for that you'd use:

    void foo(void);

Clang internally bitcasts the variadic function declaration to a
function pointer, but doesn't use the correct address space on AVR. This
commit fixes that.

This fix is necessary to let Clang compile compiler-rt for AVR.

Differential Revision: https://reviews.llvm.org/D78125
clang/lib/CodeGen/CGExpr.cpp
clang/test/CodeGen/address-space-avr.c [new file with mode: 0644]