This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Move function from line table to the prologue (NFC)
ClosedPublic

Authored by JDevlieghere on Jul 15 2019, 2:55 PM.

Details

Summary

In LLDB, when parsing type units, we don't need to parse the whole line table. Instead, we only need to parse the support files from the line table prologue. To make that possible, this patch moves the respective functions from the LineTable into the Prologue. Because I don't think users of the LineTable should have to know that these files come from the Prologue, I've left the original methods in place, and made them redirect to the LineTable.

Diff Detail

Repository
rL LLVM

Event Timeline

JDevlieghere created this revision.Jul 15 2019, 2:55 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 15 2019, 2:55 PM
dblaikie accepted this revision.Jul 15 2019, 3:06 PM
This revision is now accepted and ready to land.Jul 15 2019, 3:06 PM
This revision was automatically updated to reflect the committed changes.
phosek added a subscriber: phosek.Jul 15 2019, 5:55 PM

This change broke lld:

/b/s/w/ir/k/llvm-project/lld/ELF/InputFiles.cpp:323:28: error: conversion function from 'nullptr_t' to 'llvm::StringRef' invokes a deleted function
          it->second.file, nullptr,
                           ^~~~~~~
/b/s/w/ir/k/llvm-project/lld/ELF/InputFiles.cpp:1637:21: note: in instantiation of member function 'lld::elf::ObjFile<llvm::object::ELFType<llvm::support::little, false> >::getVariableLoc' requested here
template class elf::ObjFile<ELF32LE>;
                    ^
/b/s/w/ir/k/llvm-project/llvm/include/llvm/ADT/StringRef.h:79:5: note: 'StringRef' has been explicitly marked deleted here
    StringRef(std::nullptr_t) = delete;
    ^
/b/s/w/ir/k/llvm-project/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h:263:59: note: passing argument to parameter 'CompDir' here
    bool getFileNameByIndex(uint64_t FileIndex, StringRef CompDir,
                                                          ^
/b/s/w/ir/k/llvm-project/lld/ELF/InputFiles.cpp:323:28: error: conversion function from 'nullptr_t' to 'llvm::StringRef' invokes a deleted function
          it->second.file, nullptr,
                           ^~~~~~~
/b/s/w/ir/k/llvm-project/lld/ELF/InputFiles.cpp:1638:21: note: in instantiation of member function 'lld::elf::ObjFile<llvm::object::ELFType<llvm::support::big, false> >::getVariableLoc' requested here
template class elf::ObjFile<ELF32BE>;
                    ^
/b/s/w/ir/k/llvm-project/llvm/include/llvm/ADT/StringRef.h:79:5: note: 'StringRef' has been explicitly marked deleted here
    StringRef(std::nullptr_t) = delete;
    ^
/b/s/w/ir/k/llvm-project/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h:263:59: note: passing argument to parameter 'CompDir' here
    bool getFileNameByIndex(uint64_t FileIndex, StringRef CompDir,
                                                          ^
/b/s/w/ir/k/llvm-project/lld/ELF/InputFiles.cpp:323:28: error: conversion function from 'nullptr_t' to 'llvm::StringRef' invokes a deleted function
          it->second.file, nullptr,
                           ^~~~~~~
/b/s/w/ir/k/llvm-project/lld/ELF/InputFiles.cpp:1639:21: note: in instantiation of member function 'lld::elf::ObjFile<llvm::object::ELFType<llvm::support::little, true> >::getVariableLoc' requested here
template class elf::ObjFile<ELF64LE>;
                    ^
/b/s/w/ir/k/llvm-project/llvm/include/llvm/ADT/StringRef.h:79:5: note: 'StringRef' has been explicitly marked deleted here
    StringRef(std::nullptr_t) = delete;
    ^
/b/s/w/ir/k/llvm-project/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h:263:59: note: passing argument to parameter 'CompDir' here
    bool getFileNameByIndex(uint64_t FileIndex, StringRef CompDir,
                                                          ^
/b/s/w/ir/k/llvm-project/lld/ELF/InputFiles.cpp:323:28: error: conversion function from 'nullptr_t' to 'llvm::StringRef' invokes a deleted function
          it->second.file, nullptr,
                           ^~~~~~~
/b/s/w/ir/k/llvm-project/lld/ELF/InputFiles.cpp:1640:21: note: in instantiation of member function 'lld::elf::ObjFile<llvm::object::ELFType<llvm::support::big, true> >::getVariableLoc' requested here
template class elf::ObjFile<ELF64BE>;
                    ^
/b/s/w/ir/k/llvm-project/llvm/include/llvm/ADT/StringRef.h:79:5: note: 'StringRef' has been explicitly marked deleted here
    StringRef(std::nullptr_t) = delete;
    ^
/b/s/w/ir/k/llvm-project/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h:263:59: note: passing argument to parameter 'CompDir' here
    bool getFileNameByIndex(uint64_t FileIndex, StringRef CompDir,
                                                          ^
4 errors generated.