diff --git a/cbackend.cpp b/cbackend.cpp index b800d4ac..314b53d6 100644 --- a/cbackend.cpp +++ b/cbackend.cpp @@ -2114,7 +2114,8 @@ bool CWriter::doInitialization(Module &M) { I->getName() == "memset" || I->getName() == "memset_pattern16" || I->getName() == "puts" || I->getName() == "printf" || I->getName() == "putchar" || - I->getName() == "fflush") + I->getName() == "fflush" || I->getName() == "malloc" || + I->getName() == "free") continue; // Don't redeclare ispc's own intrinsics @@ -3437,6 +3438,9 @@ void CWriter::visitCallInst(CallInst &I) { Callee = RF; } + if (Callee->getName() == "malloc") + Out << "(uint8_t *)"; + if (NeedsCast) { // Ok, just cast the pointer type. Out << "((";