[lld] r233449 - ELF: Simplify SymbolFile.
Rui Ueyama
ruiu at google.com
Fri Mar 27 16:26:39 PDT 2015
Author: ruiu
Date: Fri Mar 27 18:26:39 2015
New Revision: 233449
URL: http://llvm.org/viewvc/llvm-project?rev=233449&view=rev
Log:
ELF: Simplify SymbolFile.
Modified:
lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h
Modified: lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h?rev=233449&r1=233448&r2=233449&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h Fri Mar 27 18:26:39 2015
@@ -36,23 +36,13 @@ template<class ELFT>
class SymbolFile : public RuntimeFile<ELFT> {
public:
SymbolFile(ELFLinkingContext &ctx)
- : RuntimeFile<ELFT>(ctx, "Dynamic absolute symbols"), _atomsAdded(false) {
- }
-
- Atom *addAbsoluteAtom(StringRef symbolName) override {
- auto *a = RuntimeFile<ELFT>::addAbsoluteAtom(symbolName);
- if (a) _atomsAdded = true;
- return a;
- }
+ : RuntimeFile<ELFT>(ctx, "Dynamic absolute symbols") {}
Atom *addUndefinedAtom(StringRef) override {
llvm_unreachable("Cannot add undefined atoms to resolve undefined symbols");
}
- bool hasAtoms() const { return _atomsAdded; }
-
-private:
- bool _atomsAdded;
+ bool hasAtoms() const { return this->absolute().size(); }
};
template<class ELFT>
More information about the llvm-commits
mailing list