]> git.lizzy.rs Git - rust.git/commit
Correctly set return type attributes on foreign function declarations
authorBjörn Steinbrink <bsteinbr@gmail.com>
Wed, 18 Jun 2014 11:01:23 +0000 (13:01 +0200)
committerBjörn Steinbrink <bsteinbr@gmail.com>
Sat, 21 Jun 2014 17:59:57 +0000 (19:59 +0200)
commitabdbaa2e19dcf6859ae781bb9b44fed483181229
tree876ec021b8cd312ce274e5032e8f6c1380c487f2
parentf556c8cbd8af182a9dd871a4a36692a0dba7cc2e
Correctly set return type attributes on foreign function declarations

The ArgType type gives us a generic way to specify an attribute for a
type to ensure ABI conformance for foreign functions. But the code that
actually sets the argument attributes in the function declaration
only sets the attribute for the return type when the type is indirect.

Since LLVMAddAttribute() doesn't allow to set attributes on the return
type, we have to use LLVMAddFunctionAttribute() instead.

This didn't cause problems yet, because currently only some indirect
types require attributes to be set.
src/librustc/middle/trans/foreign.rs