diff options
author | Jim Laskey <jlaskey@mac.com> | 2006-03-15 19:09:58 +0000 |
---|---|---|
committer | Jim Laskey <jlaskey@mac.com> | 2006-03-15 19:09:58 +0000 |
commit | 9d0ff8e6f9077dd7fe4836c7f06524eb12cd3a7e (patch) | |
tree | 49053e4f849d35a9da54d03ef52173f89c49e6d5 /lib/CodeGen/DwarfWriter.cpp | |
parent | 26c2e73da6162667e8f9f315339d9ed30b9be10c (diff) |
Expand subprogram and added block descriptor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26782 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/DwarfWriter.cpp')
-rw-r--r-- | lib/CodeGen/DwarfWriter.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/CodeGen/DwarfWriter.cpp b/lib/CodeGen/DwarfWriter.cpp index 68aeb101d6..b77721dd0c 100644 --- a/lib/CodeGen/DwarfWriter.cpp +++ b/lib/CodeGen/DwarfWriter.cpp @@ -1518,19 +1518,19 @@ DIE *DwarfWriter::NewSubprogram(SubprogramDesc *SPD) { // Gather the details (simplify add attribute code.) const std::string &Name = SPD->getName(); - unsigned FileID = Unit->getID(); - // FIXME - faking the line for the time being. - unsigned Line = 1; - - // FIXME - faking the type for the time being. - DIE *Type = NewBasicType(Unit->getDie(), Type::IntTy); + CompileUnitDesc *FileDesc = static_cast<CompileUnitDesc *>(SPD->getFile()); + CompileUnit *File = FindCompileUnit(FileDesc); + unsigned FileID = File->getID(); + DIE *Type = NewBasicType(Unit->getDie(), Type::IntTy); + unsigned Line = SPD->getLine(); + unsigned IsExternal = SPD->isStatic() ? 0 : 1; DIE *SubprogramDie = new DIE(DW_TAG_subprogram); SubprogramDie->AddString (DW_AT_name, DW_FORM_string, Name); SubprogramDie->AddUInt (DW_AT_decl_file, 0, FileID); SubprogramDie->AddUInt (DW_AT_decl_line, 0, Line); SubprogramDie->AddDIEntry (DW_AT_type, DW_FORM_ref4, Type); - SubprogramDie->AddUInt (DW_AT_external, DW_FORM_flag, 1); + SubprogramDie->AddUInt (DW_AT_external, DW_FORM_flag, IsExternal); // Add to map. Slot = SubprogramDie; |