Skip to content

Commit c46be96

Browse files
committed
[MC] Optimize isInSection
Remove one call of getFragment. The `SetUsed` bit isn't need here.
1 parent a54ad59 commit c46be96

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/include/llvm/MC/MCSymbol.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ class MCSymbol {
252252
/// isInSection - Check if this symbol is defined in some section (i.e., it
253253
/// is defined but not absolute).
254254
bool isInSection() const {
255-
return isDefined() && !isAbsolute();
255+
auto *F = getFragment(0);
256+
return F && F != AbsolutePseudoFragment;
256257
}
257258

258259
/// isUndefined - Check if this symbol undefined (i.e., implicitly defined).

0 commit comments

Comments
 (0)