Skip to content

Commit 507d7dc

Browse files
committed
[LoongArch] Simplify getRelocType
1 parent a630ef7 commit 507d7dc

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchELFObjectWriter.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ unsigned LoongArchELFObjectWriter::getRelocType(MCContext &Ctx,
5050
const MCValue &Target,
5151
const MCFixup &Fixup,
5252
bool IsPCRel) const {
53-
// Determine the type of the relocation
54-
unsigned Kind = Fixup.getTargetKind();
55-
56-
if (Kind >= FirstLiteralRelocationKind)
57-
return Kind - FirstLiteralRelocationKind;
58-
5953
switch (Target.getSpecifier()) {
6054
case LoongArchMCExpr::VK_TLS_LE_HI20:
6155
case LoongArchMCExpr::VK_TLS_IE_PC_HI20:
@@ -77,6 +71,7 @@ unsigned LoongArchELFObjectWriter::getRelocType(MCContext &Ctx,
7771
break;
7872
}
7973

74+
unsigned Kind = Fixup.getTargetKind();
8075
if (Kind >= FirstRelocationKind)
8176
return Kind - FirstRelocationKind;
8277
switch (Kind) {

0 commit comments

Comments
 (0)