diff options
author | Eric Christopher <echristo@apple.com> | 2012-04-03 00:43:49 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2012-04-03 00:43:49 +0000 |
commit | 34164196af54ffa242e0c92af1031af079709439 (patch) | |
tree | 97f75c2f45baf1af86aa5ac41c1f62e5d63cf82b /llvm/lib/Analysis/DIBuilder.cpp | |
parent | 1b8af411168bd0f0374f346b5ac55718fbe58448 (diff) | |
download | bcm5719-llvm-34164196af54ffa242e0c92af1031af079709439.tar.gz bcm5719-llvm-34164196af54ffa242e0c92af1031af079709439.zip |
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
llvm-svn: 153916
Diffstat (limited to 'llvm/lib/Analysis/DIBuilder.cpp')
-rw-r--r-- | llvm/lib/Analysis/DIBuilder.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/DIBuilder.cpp b/llvm/lib/Analysis/DIBuilder.cpp index 4dc8f6a1ecc..85913b11bef 100644 --- a/llvm/lib/Analysis/DIBuilder.cpp +++ b/llvm/lib/Analysis/DIBuilder.cpp @@ -17,6 +17,7 @@ #include "llvm/IntrinsicInst.h" #include "llvm/Module.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/Support/Debug.h" #include "llvm/Support/Dwarf.h" using namespace llvm; @@ -825,6 +826,7 @@ DISubprogram DIBuilder::createFunction(DIDescriptor Context, DIFile File, unsigned LineNo, DIType Ty, bool isLocalToUnit, bool isDefinition, + unsigned ScopeLine, unsigned Flags, bool isOptimized, Function *Fn, MDNode *TParams, @@ -854,7 +856,8 @@ DISubprogram DIBuilder::createFunction(DIDescriptor Context, Fn, TParams, Decl, - THolder + THolder, + ConstantInt::get(Type::getInt32Ty(VMContext), ScopeLine) }; MDNode *Node = MDNode::get(VMContext, Elts); @@ -902,7 +905,9 @@ DISubprogram DIBuilder::createMethod(DIDescriptor Context, Fn, TParam, llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)), - THolder + THolder, + // FIXME: Do we want to use a different scope lines? + ConstantInt::get(Type::getInt32Ty(VMContext), LineNo) }; MDNode *Node = MDNode::get(VMContext, Elts); return DISubprogram(Node); |