mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-12 01:25:10 +00:00
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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user