[lld] r234358 - [ELF] Set `addAbsoluteAtom` and `addUndefinedAtom` functions return type to void
Simon Atanasyan
simon at atanasyan.com
Tue Apr 7 14:12:28 PDT 2015
Author: atanasyan
Date: Tue Apr 7 16:12:28 2015
New Revision: 234358
URL: http://llvm.org/viewvc/llvm-project?rev=234358&view=rev
Log:
[ELF] Set `addAbsoluteAtom` and `addUndefinedAtom` functions return type to void
We do not use values returned by these functions anywhere.
So let's return nothing.
Modified:
lld/trunk/lib/ReaderWriter/ELF/ELFFile.h
lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h
Modified: lld/trunk/lib/ReaderWriter/ELF/ELFFile.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ELFFile.h?rev=234358&r1=234357&r2=234358&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/ELFFile.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/ELFFile.h Tue Apr 7 16:12:28 2015
@@ -450,7 +450,7 @@ public:
: ELFFile<ELFT>(name, ctx) {}
/// \brief add a global absolute atom
- virtual Atom *addAbsoluteAtom(StringRef symbolName) {
+ virtual void addAbsoluteAtom(StringRef symbolName) {
assert(!symbolName.empty() && "AbsoluteAtoms must have a name");
Elf_Sym *sym = new (this->_readerStorage) Elf_Sym;
sym->st_name = 0;
@@ -461,11 +461,10 @@ public:
sym->st_size = 0;
ELFAbsoluteAtom<ELFT> *atom = this->createAbsoluteAtom(symbolName, sym, -1);
this->_absoluteAtoms._atoms.push_back(atom);
- return atom;
}
/// \brief add an undefined atom
- virtual Atom *addUndefinedAtom(StringRef symbolName) {
+ virtual void addUndefinedAtom(StringRef symbolName) {
assert(!symbolName.empty() && "UndefinedAtoms must have a name");
Elf_Sym *sym = new (this->_readerStorage) Elf_Sym;
sym->st_name = 0;
@@ -476,7 +475,6 @@ public:
sym->st_size = 0;
ELFUndefinedAtom<ELFT> *atom = this->createUndefinedAtom(symbolName, sym);
this->_undefinedAtoms._atoms.push_back(atom);
- return atom;
}
// cannot add atoms to Runtime file
Modified: lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h?rev=234358&r1=234357&r2=234358&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h Tue Apr 7 16:12:28 2015
@@ -37,7 +37,7 @@ public:
SymbolFile(ELFLinkingContext &ctx)
: RuntimeFile<ELFT>(ctx, "Dynamic absolute symbols") {}
- Atom *addUndefinedAtom(StringRef) override {
+ void addUndefinedAtom(StringRef) override {
llvm_unreachable("Cannot add undefined atoms to resolve undefined symbols");
}
More information about the llvm-commits
mailing list