Skip to content

Commit 4f80508

Browse files
authored
[lld] Add explicit conversion for enum to Twine. (#100627)
This fixes `error: ambiguous conversion for functional-style cast from 'lld::macho::InputSection::Kind' to 'llvm::Twine'`, observed when building with clang-9 and reported here: #96268 (comment).
1 parent 82c21f0 commit 4f80508

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lld/MachO/BPSectionOrderer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ getRelocHash(const Reloc &reloc,
4848
sectionIdx = sectionIdxIt->getSecond();
4949
std::string kind;
5050
if (isec)
51-
kind = ("Section " + Twine(isec->kind())).str();
51+
kind = ("Section " + Twine((uint8_t)isec->kind())).str();
5252
if (auto *sym = reloc.referent.dyn_cast<Symbol *>()) {
53-
kind += (" Symbol " + Twine(sym->kind())).str();
53+
kind += (" Symbol " + Twine((uint8_t)sym->kind())).str();
5454
if (auto *d = dyn_cast<Defined>(sym)) {
5555
if (isa_and_nonnull<CStringInputSection>(isec))
5656
return getRelocHash(kind, 0, isec->getOffset(d->value), reloc.addend);

0 commit comments

Comments
 (0)