aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/ObjectFile.cpp
diff options
context:
space:
mode:
authorDaniel Thornburgh <dthorn@google.com>2022-08-23 13:39:33 -0700
committerDaniel Thornburgh <dthorn@google.com>2022-09-28 13:35:35 -0700
commite61d89efd78b17f4969c9a394f480367307c7132 (patch)
tree2802a1819697f1f4ec0909ec2a44e7769947d7e5 /llvm/lib/Object/ObjectFile.cpp
parent97f919820b075fe49393405bf0ea990cf820ffeb (diff)
downloadllvm-e61d89efd78b17f4969c9a394f480367307c7132.zip
llvm-e61d89efd78b17f4969c9a394f480367307c7132.tar.gz
llvm-e61d89efd78b17f4969c9a394f480367307c7132.tar.bz2
[NFC] [Object] Create library to fetch debug info by build ID.
This creates a library for fetching debug info by build ID, whether locally or remotely via debuginfod. The functionality was refactored out of existing code in the Symboliize library. Existing utilities were refactored to use this library. Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D132504
Diffstat (limited to 'llvm/lib/Object/ObjectFile.cpp')
-rw-r--r--llvm/lib/Object/ObjectFile.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Object/ObjectFile.cpp b/llvm/lib/Object/ObjectFile.cpp
index bc8e602..56a1d09 100644
--- a/llvm/lib/Object/ObjectFile.cpp
+++ b/llvm/lib/Object/ObjectFile.cpp
@@ -96,6 +96,11 @@ bool ObjectFile::isBerkeleyData(DataRefImpl Sec) const {
bool ObjectFile::isDebugSection(DataRefImpl Sec) const { return false; }
+bool ObjectFile::hasDebugInfo() const {
+ return any_of(sections(),
+ [](SectionRef Sec) { return Sec.isDebugSection(); });
+}
+
Expected<section_iterator>
ObjectFile::getRelocatedSection(DataRefImpl Sec) const {
return section_iterator(SectionRef(Sec, this));