We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 209dadf commit 34d15eaCopy full SHA for 34d15ea
lld/MachO/InputFiles.cpp
@@ -70,6 +70,8 @@
70
#include "llvm/TextAPI/Architecture.h"
71
#include "llvm/TextAPI/InterfaceFile.h"
72
73
+#include <type_traits>
74
+
75
using namespace llvm;
76
using namespace llvm::MachO;
77
using namespace llvm::support::endian;
@@ -358,6 +360,9 @@ void ObjFile::parseSections(ArrayRef<SectionHeader> sectionHeaders) {
358
360
template <class T>
359
361
static InputSection *findContainingSubsection(Subsections &subsections,
362
T *offset) {
363
+ static_assert(std::is_same<uint64_t, T>::value ||
364
+ std::is_same<uint32_t, T>::value,
365
+ "unexpected type for offset");
366
auto it = std::prev(llvm::upper_bound(
367
subsections, *offset,
368
[](uint64_t value, Subsection subsec) { return value < subsec.offset; }));
0 commit comments