Skip to content

Commit ae37558

Browse files
committed
Remove unnecessary condition check when tag exists.
1 parent d7517cd commit ae37558

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

llvm/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.cpp

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -216,17 +216,11 @@ void AArch64TargetStreamer::emitAttribute(StringRef VendorName, unsigned Tag,
216216
for (MCELFStreamer::AttributeItem &Item : SubSection.Content) {
217217
// Tag already exists
218218
if (Item.Tag == Tag) {
219-
// New value for existing tag: update tag
220-
if ((unsigned(-1) != Value && Item.IntValue != Value) ||
221-
("" != String && Item.StringValue != String)) {
222-
Item.Type = unsigned(-1) != Value
223-
? MCELFStreamer::AttributeItem::NumericAttribute
224-
: MCELFStreamer::AttributeItem::TextAttribute;
225-
Item.IntValue = unsigned(-1) != Value ? Value : unsigned(-1);
226-
Item.StringValue = unsigned(-1) != Value ? "" : String;
227-
return;
228-
}
229-
// Same value for existing tag: do nothing
219+
Item.Type = unsigned(-1) != Value
220+
? MCELFStreamer::AttributeItem::NumericAttribute
221+
: MCELFStreamer::AttributeItem::TextAttribute;
222+
Item.IntValue = unsigned(-1) != Value ? Value : unsigned(-1);
223+
Item.StringValue = unsigned(-1) != Value ? "" : String;
230224
return;
231225
}
232226
}

0 commit comments

Comments
 (0)