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:
Matt Pharr
2012-04-25 08:41:28 -10:00
parent 260d7298c3
commit 0baa2b484d
2 changed files with 36 additions and 16 deletions

2
ctx.h
View File

@@ -641,7 +641,7 @@ private:
/** DISubprogram corresponding to this function (used for debugging
info). */
llvm::DISubprogram diFunction;
llvm::DISubprogram diSubprogram;
/** These correspond to the current set of nested scopes in the
function. */