Skip to content

Commit f8ee63d

Browse files
[ExecutionEngine] Remove unnecessary casts (NFC) (#150785)
getArch() already returns Triple::ArchType.
1 parent f053b73 commit f8ee63d

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ RuntimeDyldImpl::loadObjectImpl(const object::ObjectFile &Obj) {
183183
std::lock_guard<sys::Mutex> locked(lock);
184184

185185
// Save information about our target
186-
Arch = (Triple::ArchType)Obj.getArch();
186+
Arch = Obj.getArch();
187187
IsTargetLittleEndian = Obj.isLittleEndian();
188188
setMipsABI(Obj);
189189

@@ -1361,18 +1361,17 @@ std::unique_ptr<RuntimeDyld::LoadedObjectInfo>
13611361
RuntimeDyld::loadObject(const ObjectFile &Obj) {
13621362
if (!Dyld) {
13631363
if (Obj.isELF())
1364-
Dyld =
1365-
createRuntimeDyldELF(static_cast<Triple::ArchType>(Obj.getArch()),
1366-
MemMgr, Resolver, ProcessAllSections,
1367-
std::move(NotifyStubEmitted));
1364+
Dyld = createRuntimeDyldELF(Obj.getArch(), MemMgr, Resolver,
1365+
ProcessAllSections,
1366+
std::move(NotifyStubEmitted));
13681367
else if (Obj.isMachO())
1369-
Dyld = createRuntimeDyldMachO(
1370-
static_cast<Triple::ArchType>(Obj.getArch()), MemMgr, Resolver,
1371-
ProcessAllSections, std::move(NotifyStubEmitted));
1368+
Dyld = createRuntimeDyldMachO(Obj.getArch(), MemMgr, Resolver,
1369+
ProcessAllSections,
1370+
std::move(NotifyStubEmitted));
13721371
else if (Obj.isCOFF())
1373-
Dyld = createRuntimeDyldCOFF(
1374-
static_cast<Triple::ArchType>(Obj.getArch()), MemMgr, Resolver,
1375-
ProcessAllSections, std::move(NotifyStubEmitted));
1372+
Dyld = createRuntimeDyldCOFF(Obj.getArch(), MemMgr, Resolver,
1373+
ProcessAllSections,
1374+
std::move(NotifyStubEmitted));
13761375
else
13771376
report_fatal_error("Incompatible object format!");
13781377
}

0 commit comments

Comments
 (0)