Skip to content

Commit 8b06eca

Browse files
committed
Simplify the PC offset declaration
1 parent a5489fc commit 8b06eca

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -370,16 +370,9 @@ class RuntimeDyldCheckerExprEval {
370370
? Checker.getSymbolLocalAddr(Symbol)
371371
: Checker.getSymbolRemoteAddr(Symbol);
372372

373-
uint64_t PCOffset = 0;
373+
// ARM mode adds an offset of 4 bytes to PC
374374
auto TT = Checker.getTripleForSymbol(Checker.getTargetFlag(Symbol));
375-
switch (TT.getArch()) {
376-
case Triple::ArchType::arm:
377-
// ARM mode adds an offset of 4 bytes to PC
378-
PCOffset = 4;
379-
break;
380-
default:
381-
PCOffset = 0;
382-
}
375+
uint64_t PCOffset = TT.getArch() == Triple::ArchType::arm ? 4 : 0;
383376

384377
uint64_t NextPC = SymbolAddr + InstSize + PCOffset;
385378

0 commit comments

Comments
 (0)