diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-02-03 16:57:20 -0500 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-02-03 16:57:20 -0500 |
commit | a556d1e8e5a55b9b2ac6d24bad4f01099c08c8c9 (patch) | |
tree | aa9424e9c2150a52572a2734d16922520d9ce986 /lib/Target/JSBackend | |
parent | 17b136d743c3d9db331c365a58c987a12eb1a32a (diff) |
emit ffi casts only when necessary
Diffstat (limited to 'lib/Target/JSBackend')
-rw-r--r-- | lib/Target/JSBackend/CallHandlers.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Target/JSBackend/CallHandlers.h b/lib/Target/JSBackend/CallHandlers.h index b286b54339..d2f8231dca 100644 --- a/lib/Target/JSBackend/CallHandlers.h +++ b/lib/Target/JSBackend/CallHandlers.h @@ -98,7 +98,8 @@ DEF_CALL_HANDLER(__default__, { getAssign(getJSName(CI), InstRT); // ensure the variable is defined, but do not emit it here // it should have 0 uses, but just to be safe } else if (!ActualRT->isVoidTy()) { - text = getAssign(getJSName(CI), ActualRT) + getCast(text, ActualRT, ASM_NONSPECIFIC | ASM_FFI); + unsigned FFI = NeedCasts ? ASM_FFI : 0; + text = getAssign(getJSName(CI), ActualRT) + getCast(text, ActualRT, ASM_NONSPECIFIC | FFI); } return text; }) |