summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp')
-rw-r--r--lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp112
1 files changed, 56 insertions, 56 deletions
diff --git a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
index dc4c2e11323..30ede7698a9 100644
--- a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
+++ b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
@@ -564,20 +564,20 @@ template <> struct MappingTraits<const lld::File *> {
const lld::File *denormalize(IO &io) { return this; }
- virtual const atom_collection<lld::DefinedAtom> &defined() const {
+ const atom_collection<lld::DefinedAtom> &defined() const override {
return _noDefinedAtoms;
}
- virtual const atom_collection<lld::UndefinedAtom> &undefined() const {
+ const atom_collection<lld::UndefinedAtom> &undefined() const override {
return _noUndefinedAtoms;
}
virtual const atom_collection<lld::SharedLibraryAtom> &
- sharedLibrary() const {
+ sharedLibrary() const override {
return _noSharedLibraryAtoms;
}
- virtual const atom_collection<lld::AbsoluteAtom> &absolute() const {
+ const atom_collection<lld::AbsoluteAtom> &absolute() const override {
return _noAbsoluteAtoms;
}
- virtual const File *find(StringRef name, bool dataSymbolOnly) const {
+ const File *find(StringRef name, bool dataSymbolOnly) const override {
for (const ArchMember &member : _members) {
for (const lld::DefinedAtom *atom : member._content->defined()) {
if (name == atom->name()) {
@@ -597,7 +597,7 @@ template <> struct MappingTraits<const lld::File *> {
}
virtual error_code
- parseAllMembers(std::vector<std::unique_ptr<File>> &result) const {
+ parseAllMembers(std::vector<std::unique_ptr<File>> &result) const override {
return error_code::success();
}
@@ -622,17 +622,17 @@ template <> struct MappingTraits<const lld::File *> {
}
const lld::File *denormalize(IO &io);
- virtual const atom_collection<lld::DefinedAtom> &defined() const {
+ const atom_collection<lld::DefinedAtom> &defined() const override {
return _definedAtoms;
}
- virtual const atom_collection<lld::UndefinedAtom> &undefined() const {
+ const atom_collection<lld::UndefinedAtom> &undefined() const override {
return _undefinedAtoms;
}
virtual const atom_collection<lld::SharedLibraryAtom> &
- sharedLibrary() const {
+ sharedLibrary() const override {
return _sharedLibraryAtoms;
}
- virtual const atom_collection<lld::AbsoluteAtom> &absolute() const {
+ const atom_collection<lld::AbsoluteAtom> &absolute() const override {
return _absoluteAtoms;
}
@@ -727,11 +727,11 @@ template <> struct MappingTraits<const lld::Reference *> {
void bind(const RefNameResolver &);
static StringRef targetName(IO &io, const lld::Reference *ref);
- virtual uint64_t offsetInAtom() const { return _offset; }
- virtual const lld::Atom *target() const { return _target; }
- virtual Addend addend() const { return _addend; }
- virtual void setAddend(Addend a) { _addend = a; }
- virtual void setTarget(const lld::Atom *a) { _target = a; }
+ uint64_t offsetInAtom() const override { return _offset; }
+ const lld::Atom *target() const override { return _target; }
+ Addend addend() const override { return _addend; }
+ void setAddend(Addend a) override { _addend = a; }
+ void setTarget(const lld::Atom *a) override { _target = a; }
const lld::Atom *_target;
StringRef _targetName;
@@ -806,46 +806,46 @@ template <> struct MappingTraits<const lld::DefinedAtom *> {
return *info->_file;
}
- virtual const lld::File &file() const { return _file; }
- virtual StringRef name() const { return _name; }
- virtual uint64_t size() const { return _size; }
- virtual Scope scope() const { return _scope; }
- virtual Interposable interposable() const { return _interpose; }
- virtual Merge merge() const { return _merge; }
- virtual ContentType contentType() const { return _contentType; }
- virtual Alignment alignment() const { return _alignment; }
- virtual SectionChoice sectionChoice() const { return _sectionChoice; }
- virtual StringRef customSectionName() const { return _sectionName; }
- virtual SectionPosition sectionPosition() const { return _sectionPosition; }
- virtual DeadStripKind deadStrip() const { return _deadStrip; }
- virtual DynamicExport dynamicExport() const { return _dynamicExport; }
- virtual ContentPermissions permissions() const { return _permissions; }
- virtual bool isAlias() const { return false; }
- ArrayRef<uint8_t> rawContent() const {
+ const lld::File &file() const override { return _file; }
+ StringRef name() const override { return _name; }
+ uint64_t size() const override { return _size; }
+ Scope scope() const override { return _scope; }
+ Interposable interposable() const override { return _interpose; }
+ Merge merge() const override { return _merge; }
+ ContentType contentType() const override { return _contentType; }
+ Alignment alignment() const override { return _alignment; }
+ SectionChoice sectionChoice() const override { return _sectionChoice; }
+ StringRef customSectionName() const override { return _sectionName; }
+ SectionPosition sectionPosition() const override { return _sectionPosition; }
+ DeadStripKind deadStrip() const override { return _deadStrip; }
+ DynamicExport dynamicExport() const override { return _dynamicExport; }
+ ContentPermissions permissions() const override { return _permissions; }
+ bool isAlias() const override { return false; }
+ ArrayRef<uint8_t> rawContent() const override {
if (!occupiesDiskSpace())
return ArrayRef<uint8_t>();
return ArrayRef<uint8_t>(
reinterpret_cast<const uint8_t *>(_content.data()), _content.size());
}
- virtual uint64_t ordinal() const { return _ordinal; }
+ uint64_t ordinal() const override { return _ordinal; }
- reference_iterator begin() const {
+ reference_iterator begin() const override {
uintptr_t index = 0;
const void *it = reinterpret_cast<const void *>(index);
return reference_iterator(*this, it);
}
- reference_iterator end() const {
+ reference_iterator end() const override {
uintptr_t index = _references.size();
const void *it = reinterpret_cast<const void *>(index);
return reference_iterator(*this, it);
}
- const lld::Reference *derefIterator(const void *it) const {
+ const lld::Reference *derefIterator(const void *it) const override {
uintptr_t index = reinterpret_cast<uintptr_t>(it);
assert(index < _references.size());
return _references[index];
}
- void incrementIterator(const void *&it) const {
+ void incrementIterator(const void *&it) const override {
uintptr_t index = reinterpret_cast<uintptr_t>(it);
++index;
it = reinterpret_cast<const void *>(index);
@@ -953,10 +953,10 @@ template <> struct MappingTraits<const lld::UndefinedAtom *> {
return *info->_file;
}
- virtual const lld::File &file() const { return _file; }
- virtual StringRef name() const { return _name; }
- virtual CanBeNull canBeNull() const { return _canBeNull; }
- virtual const UndefinedAtom *fallback() const { return _fallback; }
+ const lld::File &file() const override { return _file; }
+ StringRef name() const override { return _name; }
+ CanBeNull canBeNull() const override { return _canBeNull; }
+ const UndefinedAtom *fallback() const override { return _fallback; }
const lld::File &_file;
StringRef _name;
@@ -1014,12 +1014,12 @@ template <> struct MappingTraits<const lld::SharedLibraryAtom *> {
return *info->_file;
}
- virtual const lld::File &file() const { return _file; }
- virtual StringRef name() const { return _name; }
- virtual StringRef loadName() const { return _loadName; }
- virtual bool canBeNullAtRuntime() const { return _canBeNull; }
- virtual Type type() const { return _type; }
- virtual uint64_t size() const { return _size; }
+ const lld::File &file() const override { return _file; }
+ StringRef name() const override { return _name; }
+ StringRef loadName() const override { return _loadName; }
+ bool canBeNullAtRuntime() const override { return _canBeNull; }
+ Type type() const override { return _type; }
+ uint64_t size() const override { return _size; }
const lld::File &_file;
StringRef _name;
@@ -1074,10 +1074,10 @@ template <> struct MappingTraits<const lld::AbsoluteAtom *> {
return *info->_file;
}
- virtual const lld::File &file() const { return _file; }
- virtual StringRef name() const { return _name; }
- virtual uint64_t value() const { return _value; }
- virtual Scope scope() const { return _scope; }
+ const lld::File &file() const override { return _file; }
+ StringRef name() const override { return _name; }
+ uint64_t value() const override { return _value; }
+ Scope scope() const override { return _scope; }
const lld::File &_file;
StringRef _name;
@@ -1190,7 +1190,7 @@ class Writer : public lld::Writer {
public:
Writer(const LinkingContext &context) : _context(context) {}
- virtual error_code writeFile(const lld::File &file, StringRef outPath) {
+ error_code writeFile(const lld::File &file, StringRef outPath) override {
// Create stream to path.
std::string errorInfo;
llvm::raw_fd_ostream out(outPath.data(), errorInfo, llvm::sys::fs::F_Text);
@@ -1220,7 +1220,7 @@ namespace {
/// Handles !native tagged yaml documents.
class NativeYamlIOTaggedDocumentHandler : public YamlIOTaggedDocumentHandler {
- bool handledDocTag(llvm::yaml::IO &io, const lld::File *&file) const {
+ bool handledDocTag(llvm::yaml::IO &io, const lld::File *&file) const override {
if (io.mapTag("!native")) {
MappingTraits<const lld::File *>::mappingAtoms(io, file);
return true;
@@ -1232,7 +1232,7 @@ class NativeYamlIOTaggedDocumentHandler : public YamlIOTaggedDocumentHandler {
/// Handles !archive tagged yaml documents.
class ArchiveYamlIOTaggedDocumentHandler : public YamlIOTaggedDocumentHandler {
- bool handledDocTag(llvm::yaml::IO &io, const lld::File *&file) const {
+ bool handledDocTag(llvm::yaml::IO &io, const lld::File *&file) const override {
if (io.mapTag("!archive")) {
MappingTraits<const lld::File *>::mappingArchive(io, file);
return true;
@@ -1247,13 +1247,13 @@ class YAMLReader : public Reader {
public:
YAMLReader(const Registry &registry) : _registry(registry) {}
- virtual bool canParse(file_magic, StringRef ext, const MemoryBuffer &) const {
+ bool canParse(file_magic, StringRef ext, const MemoryBuffer &) const override {
return (ext.equals(".objtxt") || ext.equals(".yaml"));
}
- virtual error_code
+ error_code
parseFile(std::unique_ptr<MemoryBuffer> &mb, const class Registry &,
- std::vector<std::unique_ptr<File>> &result) const {
+ std::vector<std::unique_ptr<File>> &result) const override {
// Note: we do not take ownership of the MemoryBuffer. That is
// because yaml may produce multiple File objects, so there is no
// *one* File to take ownership. Therefore, the yaml File objects
OpenPOWER on IntegriCloud