imageworks/OpenShadingLanguage — pull request #391 by lgritz (2014-07-03 21:27:49+00:00)
Title: Fix slightly broken function table declarations.

Wow, LLVM is awfully picky about global function declarations. If you
pass a slightly mismatched declaration to getOrInsertFunction, it will
wrap it in a casting op, which will then no longer strictly be a
llvm::Function (technically, it will be a ConstantExpr for the cast),
which in turn could fail an assertion internal to LLVM when we
llvm::cast<> it to a Function -- but only for a DEBUG compile! So much
fun. These tweaks fix the few functions that weren't quite right, and
also make a more clear assertion error message if we get it wrong in the
future.