Fix multiple bugs related to DIBuilder::createFunction() call.
The DIType passed to this method should correspond to the FunctionType of the function, not its return type. The first parameter should be the DIScope for the compile unit, not the DIFile. We previously had the unmangled function name and the mangled function name interchanged. The argument corresponding to "first line number of the function" was missing, which in turn led to subsequent arguments being off, and thus providing bogus values vs. what was supposed to be passed. Rename FunctionEmitContext::diFunction to diSubprogram, to better reflect its type.
This commit is contained in:
Reference in New Issue
Block a user