1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Use line and column number to distinguish two lexical blocks at the same level.

llvm-svn: 96395
This commit is contained in:
Devang Patel 2010-02-16 21:39:34 +00:00
parent 2acf602672
commit bebe8e55dc
2 changed files with 13 additions and 7 deletions

View File

@ -462,6 +462,8 @@ namespace llvm {
DIScope getContext() const { return getFieldAs<DIScope>(1); }
StringRef getDirectory() const { return getContext().getDirectory(); }
StringRef getFilename() const { return getContext().getFilename(); }
unsigned getLineNumber() const { return getUnsignedField(2); }
unsigned getColumnNumber() const { return getUnsignedField(3); }
};
/// DINameSpace - A wrapper for a C++ style name space.
@ -636,7 +638,8 @@ namespace llvm {
/// CreateLexicalBlock - This creates a descriptor for a lexical block
/// with the specified parent context.
DILexicalBlock CreateLexicalBlock(DIDescriptor Context);
DILexicalBlock CreateLexicalBlock(DIDescriptor Context, unsigned Line = 0,
unsigned Col = 0);
/// CreateNameSpace - This creates new descriptor for a namespace
/// with the specified parent context.

View File

@ -1007,12 +1007,15 @@ DIVariable DIFactory::CreateComplexVariable(unsigned Tag, DIDescriptor Context,
/// CreateBlock - This creates a descriptor for a lexical block with the
/// specified parent VMContext.
DILexicalBlock DIFactory::CreateLexicalBlock(DIDescriptor Context) {
DILexicalBlock DIFactory::CreateLexicalBlock(DIDescriptor Context,
unsigned LineNo, unsigned Col) {
Value *Elts[] = {
GetTagConstant(dwarf::DW_TAG_lexical_block),
Context.getNode()
Context.getNode(),
ConstantInt::get(Type::getInt32Ty(VMContext), LineNo),
ConstantInt::get(Type::getInt32Ty(VMContext), Col)
};
return DILexicalBlock(MDNode::get(VMContext, &Elts[0], 2));
return DILexicalBlock(MDNode::get(VMContext, &Elts[0], 4));
}
/// CreateNameSpace - This creates new descriptor for a namespace