diff options
Diffstat (limited to 'lld/include/lld/Core/UndefinedAtom.h')
| -rw-r--r-- | lld/include/lld/Core/UndefinedAtom.h | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/lld/include/lld/Core/UndefinedAtom.h b/lld/include/lld/Core/UndefinedAtom.h index 11817b380db..d1c94369589 100644 --- a/lld/include/lld/Core/UndefinedAtom.h +++ b/lld/include/lld/Core/UndefinedAtom.h @@ -20,31 +20,22 @@ namespace lld { /// It exists as a place holder for a future atom. class UndefinedAtom : public Atom { public: - UndefinedAtom(llvm::StringRef nm, bool weakImport, const File& f) - : _name(nm), _file(f), _weakImport(weakImport) {} - - virtual const File& file() const { - return _file; - } - - virtual llvm::StringRef name() const { - return _name; - } - virtual Definition definition() const { return Atom::definitionUndefined; } - virtual bool weakImport() const { - return _weakImport; + /// like dynamic_cast, if atom is definitionUndefined + /// returns atom cast to UndefinedAtom*, else returns NULL + virtual const UndefinedAtom* undefinedAtom() const { + return this; } + /// returns if undefined symbol can be missing at runtime + virtual bool weakImport() const = 0; + protected: + UndefinedAtom() {} virtual ~UndefinedAtom() {} - - llvm::StringRef _name; - const File& _file; - bool _weakImport; }; } // namespace lld |

