Add a line number for the scope of the function (starting at the first

brace) so that we get more accurate line number information about the
declaration of a given function and the line where the function
first starts.

Part of rdar://11026482

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153916 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher
2012-04-03 00:43:49 +00:00
parent 2e267ae7b8
commit 6126a1e189
6 changed files with 29 additions and 5 deletions

View File

@@ -445,6 +445,7 @@ namespace llvm {
/// @param Ty Function type.
/// @param isLocalToUnit True if this function is not externally visible..
/// @param isDefinition True if this is a function definition.
/// @param ScopeLine Set to the beginning of the scope this starts
/// @param Flags e.g. is this function prototyped or not.
/// This flags are used to emit dwarf attributes.
/// @param isOptimized True if optimization is ON.
@@ -455,6 +456,7 @@ namespace llvm {
DIFile File, unsigned LineNo,
DIType Ty, bool isLocalToUnit,
bool isDefinition,
unsigned ScopeLine,
unsigned Flags = 0,
bool isOptimized = false,
Function *Fn = 0,

View File

@@ -519,6 +519,7 @@ namespace llvm {
DICompositeType getContainingType() const {
return getFieldAs<DICompositeType>(13);
}
unsigned isArtificial() const {
if (getVersion() <= llvm::LLVMDebugVersion8)
return getUnsignedField(14);
@@ -567,6 +568,11 @@ namespace llvm {
return getFieldAs<DIFile>(6).getDirectory();
}
/// getScopeLineNumber - Get the beginning of the scope of the
/// function, not necessarily where the name of the program
/// starts.
unsigned getScopeLineNumber() const { return getUnsignedField(20); }
/// Verify - Verify that a subprogram descriptor is well formed.
bool Verify() const;