Skip to content

Commit 4afcfd7

Browse files
committed
[ELF] Sort DWARF.h sections. NFC
to make it clear whether .debug_names should be added. And include llvm/ADT/STLFunctionalExtras.h for IWYU.
1 parent a332cfc commit 4afcfd7

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

lld/ELF/DWARF.h

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include "InputFiles.h"
1313
#include "llvm/ADT/STLExtras.h"
14+
#include "llvm/ADT/STLFunctionalExtras.h"
1415
#include "llvm/DebugInfo/DWARF/DWARFContext.h"
1516
#include "llvm/Object/ELF.h"
1617
#include <optional>
@@ -36,34 +37,28 @@ template <class ELFT> class LLDDwarfObj final : public llvm::DWARFObject {
3637
return cast<InputSection>(infoSection.sec);
3738
}
3839

40+
const llvm::DWARFSection &getAddrSection() const override {
41+
return addrSection;
42+
}
43+
const llvm::DWARFSection &getLineSection() const override {
44+
return lineSection;
45+
}
3946
const llvm::DWARFSection &getLoclistsSection() const override {
4047
return loclistsSection;
4148
}
42-
4349
const llvm::DWARFSection &getRangesSection() const override {
4450
return rangesSection;
4551
}
46-
4752
const llvm::DWARFSection &getRnglistsSection() const override {
4853
return rnglistsSection;
4954
}
50-
5155
const llvm::DWARFSection &getStrOffsetsSection() const override {
5256
return strOffsetsSection;
5357
}
5458

55-
const llvm::DWARFSection &getLineSection() const override {
56-
return lineSection;
57-
}
58-
59-
const llvm::DWARFSection &getAddrSection() const override {
60-
return addrSection;
61-
}
62-
6359
const LLDDWARFSection &getGnuPubnamesSection() const override {
6460
return gnuPubnamesSection;
6561
}
66-
6762
const LLDDWARFSection &getGnuPubtypesSection() const override {
6863
return gnuPubtypesSection;
6964
}
@@ -86,18 +81,18 @@ template <class ELFT> class LLDDwarfObj final : public llvm::DWARFObject {
8681
uint64_t pos,
8782
ArrayRef<RelTy> rels) const;
8883

84+
LLDDWARFSection addrSection;
8985
LLDDWARFSection gnuPubnamesSection;
9086
LLDDWARFSection gnuPubtypesSection;
9187
LLDDWARFSection infoSection;
88+
LLDDWARFSection lineSection;
9289
LLDDWARFSection loclistsSection;
9390
LLDDWARFSection rangesSection;
9491
LLDDWARFSection rnglistsSection;
9592
LLDDWARFSection strOffsetsSection;
96-
LLDDWARFSection lineSection;
97-
LLDDWARFSection addrSection;
9893
StringRef abbrevSection;
99-
StringRef strSection;
10094
StringRef lineStrSection;
95+
StringRef strSection;
10196
};
10297

10398
} // namespace lld::elf

lld/ELF/SyntheticSections.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "Symbols.h"
2626
#include "llvm/ADT/DenseSet.h"
2727
#include "llvm/ADT/MapVector.h"
28+
#include "llvm/ADT/STLFunctionalExtras.h"
2829
#include "llvm/BinaryFormat/ELF.h"
2930
#include "llvm/MC/StringTableBuilder.h"
3031
#include "llvm/Support/Compiler.h"

0 commit comments

Comments
 (0)