• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===- Core/AbsoluteAtom.h - An absolute Atom -----------------------------===//
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 #ifndef LLD_CORE_ABSOLUTE_ATOM_H
10 #define LLD_CORE_ABSOLUTE_ATOM_H
11 
12 #include "lld/Core/Atom.h"
13 
14 namespace lld {
15 
16 /// An AbsoluteAtom has no content.
17 /// It exists to represent content at fixed addresses in memory.
18 class AbsoluteAtom : public Atom {
19 public:
20 
21   virtual uint64_t value() const = 0;
22 
23   /// scope - The visibility of this atom to other atoms.  C static functions
24   /// have scope scopeTranslationUnit.  Regular C functions have scope
25   /// scopeGlobal.  Functions compiled with visibility=hidden have scope
26   /// scopeLinkageUnit so they can be see by other atoms being linked but not
27   /// by the OS loader.
28   virtual Scope scope() const = 0;
29 
classof(const Atom * a)30   static bool classof(const Atom *a) {
31     return a->definition() == definitionAbsolute;
32   }
33 
classof(const AbsoluteAtom *)34   static bool classof(const AbsoluteAtom *) { return true; }
35 
36 protected:
AbsoluteAtom()37   AbsoluteAtom() : Atom(definitionAbsolute) {}
38 };
39 
40 } // namespace lld
41 
42 #endif // LLD_CORE_ABSOLUTE_ATOM_H
43