Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:15

0001 //===-- llvm/MC/MCSymbolTableEntry.h - Symbol table entry -------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_MC_MCSYMBOLTABLEENTRY_H
0010 #define LLVM_MC_MCSYMBOLTABLEENTRY_H
0011 
0012 #include "llvm/ADT/StringMapEntry.h"
0013 
0014 namespace llvm {
0015 
0016 class MCSymbol;
0017 
0018 /// The value for an entry in the symbol table of an MCContext.
0019 ///
0020 /// This is in a separate file, because MCSymbol uses MCSymbolTableEntry (see
0021 /// below) to reuse the name that is stored in the symbol table.
0022 struct MCSymbolTableValue {
0023   /// The symbol associated with the name, if any.
0024   MCSymbol *Symbol = nullptr;
0025 
0026   /// The next ID to dole out to an unnamed assembler temporary symbol with
0027   /// the prefix (symbol table key).
0028   unsigned NextUniqueID = 0;
0029 
0030   /// Whether the name associated with this value is used for a symbol. This is
0031   /// not necessarily true: sometimes, we use a symbol table value without an
0032   /// associated symbol for accessing NextUniqueID when a suffix is added to a
0033   /// name. However, Used might be true even if Symbol is nullptr: temporary
0034   /// named symbols are not added to the symbol table.
0035   bool Used = false;
0036 };
0037 
0038 /// MCContext stores MCSymbolTableValue in a string map (see MCSymbol::operator
0039 /// new). To avoid redundant storage of the name, MCSymbol stores a pointer (8
0040 /// bytes -- half the size of a StringRef) to the entry to access it.
0041 using MCSymbolTableEntry = StringMapEntry<MCSymbolTableValue>;
0042 
0043 } // end namespace llvm
0044 
0045 #endif