xref: /freebsd/contrib/llvm-project/llvm/include/llvm/MC/MCSymbolGOFF.h (revision 700637cbb5e582861067a11aaca4d053546871d2)
1 //===-- llvm/MC/MCSymbolGOFF.h - GOFF Machine Code Symbols ------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 ///
9 /// \file
10 /// This file contains the MCSymbolGOFF class
11 ///
12 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_MC_MCSYMBOLGOFF_H
14 #define LLVM_MC_MCSYMBOLGOFF_H
15 
16 #include "llvm/BinaryFormat/GOFF.h"
17 #include "llvm/MC/MCGOFFAttributes.h"
18 #include "llvm/MC/MCSectionGOFF.h"
19 #include "llvm/MC/MCSymbol.h"
20 #include "llvm/MC/MCSymbolTableEntry.h"
21 
22 namespace llvm {
23 
24 class MCSymbolGOFF : public MCSymbol {
25   // Associated data area of the section. Needs to be emitted first.
26   MCSectionGOFF *ADA;
27 
28   GOFF::LDAttr LDAttributes;
29 
30   enum SymbolFlags : uint16_t {
31     SF_LD = 0x01, // LD attributes are set.
32   };
33 
34 public:
MCSymbolGOFF(const MCSymbolTableEntry * Name,bool IsTemporary)35   MCSymbolGOFF(const MCSymbolTableEntry *Name, bool IsTemporary)
36       : MCSymbol(SymbolKindGOFF, Name, IsTemporary) {}
37 
setLDAttributes(GOFF::LDAttr Attr)38   void setLDAttributes(GOFF::LDAttr Attr) {
39     modifyFlags(SF_LD, SF_LD);
40     LDAttributes = Attr;
41   }
getLDAttributes()42   GOFF::LDAttr getLDAttributes() const { return LDAttributes; }
hasLDAttributes()43   bool hasLDAttributes() const { return getFlags() & SF_LD; }
44 
setADA(MCSectionGOFF * AssociatedDataArea)45   void setADA(MCSectionGOFF *AssociatedDataArea) {
46     ADA = AssociatedDataArea;
47     AssociatedDataArea->RequiresNonZeroLength = true;
48   }
getADA()49   MCSectionGOFF *getADA() const { return ADA; }
50 
classof(const MCSymbol * S)51   static bool classof(const MCSymbol *S) { return S->isGOFF(); }
52 };
53 } // end namespace llvm
54 
55 #endif
56