@@ -90,9 +90,6 @@ class MCSymbol {
9090 // / True if this symbol can be redefined.
9191 unsigned IsRedefinable : 1 ;
9292
93- // / IsUsed - True if this symbol has been used.
94- mutable unsigned IsUsed : 1 ;
95-
9693 mutable unsigned IsRegistered : 1 ;
9794
9895 // / True if this symbol is visible outside this translation unit. Note: ELF
@@ -165,16 +162,19 @@ class MCSymbol {
165162 };
166163
167164 MCSymbol (SymbolKind Kind, const MCSymbolTableEntry *Name, bool isTemporary)
168- : IsTemporary(isTemporary), IsRedefinable(false ), IsUsed (false ),
169- IsRegistered (false ), IsExternal (false ), IsPrivateExtern (false ),
170- IsWeakExternal( false ), Kind(Kind), IsUsedInReloc(false ), IsResolving(0 ),
165+ : IsTemporary(isTemporary), IsRedefinable(false ), IsRegistered (false ),
166+ IsExternal (false ), IsPrivateExtern (false ), IsWeakExternal (false ),
167+ Kind(Kind), IsUsedInReloc(false ), IsResolving(0 ),
171168 SymbolContents(SymContentsUnset), CommonAlignLog2(0 ), Flags(0 ) {
172169 Offset = 0 ;
173170 HasName = !!Name;
174171 if (Name)
175172 getNameEntryPtr () = Name;
176173 }
177174
175+ MCSymbol (const MCSymbol &) = default;
176+ MCSymbol &operator =(const MCSymbol &) = delete ;
177+
178178 // Provide custom new/delete as we will only allocate space for a name
179179 // if we need one.
180180 void *operator new (size_t s, const MCSymbolTableEntry *Name, MCContext &Ctx);
@@ -201,9 +201,6 @@ class MCSymbol {
201201 }
202202
203203public:
204- MCSymbol (const MCSymbol &) = delete ;
205- MCSymbol &operator =(const MCSymbol &) = delete ;
206-
207204 // / getName - Get the symbol name.
208205 StringRef getName () const {
209206 if (!HasName)
@@ -224,9 +221,6 @@ class MCSymbol {
224221 // / isTemporary - Check if this is an assembler temporary symbol.
225222 bool isTemporary () const { return IsTemporary; }
226223
227- // / isUsed - Check if this is used.
228- bool isUsed () const { return IsUsed; }
229-
230224 // / Check if this symbol is redefinable.
231225 bool isRedefinable () const { return IsRedefinable; }
232226 // / Mark this symbol as redefinable.
@@ -258,7 +252,7 @@ class MCSymbol {
258252 // / isInSection - Check if this symbol is defined in some section (i.e., it
259253 // / is defined but not absolute).
260254 bool isInSection () const {
261- auto *F = getFragment (0 );
255+ auto *F = getFragment ();
262256 return F && F != AbsolutePseudoFragment;
263257 }
264258
@@ -306,10 +300,9 @@ class MCSymbol {
306300 return SymbolContents == SymContentsVariable;
307301 }
308302
309- // / getVariableValue - Get the value for variable symbols .
303+ // / Get the expression of the variable symbol .
310304 const MCExpr *getVariableValue (bool SetUsed = true ) const {
311305 assert (isVariable () && " Invalid accessor!" );
312- IsUsed |= SetUsed;
313306 return Value;
314307 }
315308
@@ -399,12 +392,12 @@ class MCSymbol {
399392 return SymbolContents == SymContentsTargetCommon;
400393 }
401394
402- MCFragment *getFragment (bool SetUsed = false ) const {
395+ MCFragment *getFragment () const {
403396 if (Fragment || !isVariable () || isWeakExternal ())
404397 return Fragment;
405398 // If the symbol is a non-weak alias, get information about
406399 // the aliasee. (Don't try to resolve weak aliases.)
407- Fragment = getVariableValue (SetUsed )->findAssociatedFragment ();
400+ Fragment = getVariableValue ()->findAssociatedFragment ();
408401 return Fragment;
409402 }
410403
0 commit comments