Home | History | Annotate | Download | only in Core

Lines Matching defs:atom

1 //===- Core/Atom.h - A node in linking graph --------------------*- C++ -*-===//
25 /// as a set of Atoms with References to other Atoms. Each Atom is a node
26 /// and each Reference is an edge. An Atom can be a DefinedAtom which has
30 class Atom {
34 /// Whether this atom is defined or a proxy for an undefined symbol
42 /// The scope in which this atom is acessible to other atoms.
52 /// file - returns the File that produced/owns this Atom
55 /// name - The name of the atom. For a function atom, it is the (mangled)
59 /// definition - Whether this atom is a definition or represents an undefined
63 static bool classof(const Atom *a) { return true; }
66 /// Atom is an abstract base class. Only subclasses can access constructor.
67 explicit Atom(Definition def) : _definition(def) {}
69 /// The memory for Atom objects is always managed by the owning File
71 /// delete on an Atom. In fact, some File objects may bulk allocate
73 virtual ~Atom() = default;
79 /// Class which owns an atom pointer and runs the atom destructor when the
89 OwningAtomPtr(T *atom) : atom(atom) { }
92 if (atom)
93 runDestructor(atom);
96 void runDestructor(Atom *atom) {
97 atom->~Atom();
100 OwningAtomPtr(OwningAtomPtr &&ptr) : atom(ptr.atom) {
101 ptr.atom = nullptr;
105 if (atom)
106 runDestructor(atom);
107 atom = ptr.atom;
108 ptr.atom = nullptr;
112 return atom;
116 return atom;
120 auto *v = atom;
121 atom = nullptr;
126 T *atom = nullptr;