summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2016-02-01 23:42:10 +0000
committerPete Cooper <peter_cooper@apple.com>2016-02-01 23:42:10 +0000
commitf91b22ce2cb295da994a3488fd4ccb80410aa6bc (patch)
tree4a84aa38029d029f8b96ee8a404a008eea424eb5 /lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
parent21923996f84205d9dfbaf6095d61647b42ff2e08 (diff)
downloadbcm5719-llvm-f91b22ce2cb295da994a3488fd4ccb80410aa6bc.tar.gz
bcm5719-llvm-f91b22ce2cb295da994a3488fd4ccb80410aa6bc.zip
Move SimpleDefinedAtom::addReference to DefinedAtom.
Most of the other methods to access Reference's were on DefinedAtom so this just keeps them all together. This will be used in a future patch in ObjCPass which needs to add new references. The method is virtual because we may add references to different data structures depending on whether we parsed a macho file or yaml. llvm-svn: 259436
Diffstat (limited to 'lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp')
-rw-r--r--lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
index 3e4f51882c6..528e80c88cb 100644
--- a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
+++ b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
@@ -887,6 +887,16 @@ template <> struct MappingTraits<const lld::DefinedAtom *> {
it = reinterpret_cast<const void *>(index);
}
+ void addReference(Reference::KindNamespace ns,
+ Reference::KindArch arch,
+ Reference::KindValue kindValue, uint64_t off,
+ const Atom *target, Reference::Addend a) override {
+ assert(target && "trying to create reference to nothing");
+ auto node = new (file().allocator()) SimpleReference(ns, arch, kindValue,
+ off, target, a);
+ _references.push_back(node);
+ }
+
const lld::File &_file;
StringRef _name;
StringRef _refName;
OpenPOWER on IntegriCloud