I forgot to mention that I don't have commit access. If you or somebody else could commit this it would be great.
Jul 11 2017
Jul 9 2017
Patch updated to adhere to the coding style based on @majnemer's comments.
Patch updated. I've made the convertFreeFunctionType return null on failure.
Patch updated based on @rjmccall's comments. I removed the wrapper for the ConvertType function, after giving it some thoughts I don't see any use case for it, I guess I added it by default. I left the convertFreeFunction function as returning an llvm::Type instead of an llvm::FunctionType as ConvertFunctionType represents incomplete function types as empty aggregate types.
Jul 5 2017
Sorry, I forgot to mention that I don't have commit access. Could somebody commit this on my behalf?
Jun 26 2017
I've added a comment describing the test case.
Jun 22 2017
A test case has been added and the patch has been updated based on @efriedma's comments.
@efriedma Sorry for the test case, I did write one based on the reduced case from the PR, I'm not sure why SVN didn't include it in the diff. Anyway, I'll update to include it.