aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-11-25 18:20:13 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-11-25 18:20:13 -0800
commit946a173ee6f007ed6c233de9da3cc03a23071306 (patch)
treeec9797f0f52961d0417241013440d9e5b9ec61db
parentfcd6f72d9a1ffdf12ca361235ea58382cfc662c8 (diff)
do not assume calls are on functions - can be function pointers too
-rw-r--r--lib/Target/CppBackend/CallHandlers.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Target/CppBackend/CallHandlers.h b/lib/Target/CppBackend/CallHandlers.h
index 419bb3dd10..043054b1db 100644
--- a/lib/Target/CppBackend/CallHandlers.h
+++ b/lib/Target/CppBackend/CallHandlers.h
@@ -12,7 +12,7 @@ CallHandlerMap *CallHandlers;
std::string CH_##Ident(const CallInst *CI, std::string Name, unsigned NumArgs) { Code }
DEF_CALL_HANDLER(__default__, {
- Type *RT = CI->getCalledFunction()->getReturnType();
+ Type *RT = CI->getType();
std::string text = Name + "(";
for (unsigned i = 0; i < NumArgs; i++) {
text += getValueAsCastStr(CI->getArgOperand(i)); // FIXME: differentiate ffi calls