diff options
author | Nick Kledzik <kledzik@apple.com> | 2014-05-15 20:59:23 +0000 |
---|---|---|
committer | Nick Kledzik <kledzik@apple.com> | 2014-05-15 20:59:23 +0000 |
commit | 61fdef6086e72cdb2e148f9c1c2e87e2ed4b589d (patch) | |
tree | 3c8bc231db5a5c8edff4d4ef30e64d0c0f2c5082 /lld/lib/ReaderWriter/MachO/File.h | |
parent | 130a3b050423c7e2e2631277d705c96d0a721cac (diff) | |
download | bcm5719-llvm-61fdef6086e72cdb2e148f9c1c2e87e2ed4b589d.tar.gz bcm5719-llvm-61fdef6086e72cdb2e148f9c1c2e87e2ed4b589d.zip |
[mach-o] Add support and test cases for parsing tentative definitions
llvm-svn: 208919
Diffstat (limited to 'lld/lib/ReaderWriter/MachO/File.h')
-rw-r--r-- | lld/lib/ReaderWriter/MachO/File.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lld/lib/ReaderWriter/MachO/File.h b/lld/lib/ReaderWriter/MachO/File.h index 68aea4a042c..767d5230cf6 100644 --- a/lld/lib/ReaderWriter/MachO/File.h +++ b/lld/lib/ReaderWriter/MachO/File.h @@ -43,6 +43,18 @@ public: addAtom(*atom); } + void addTentativeDefAtom(StringRef name, Atom::Scope scope, uint64_t size, + DefinedAtom::Alignment align, bool copyRefs) { + if (copyRefs) { + // Make a copy of the atom's name that is owned by this file. + name = name.copy(_allocator); + } + MachOTentativeDefAtom *atom = + new (_allocator) MachOTentativeDefAtom(*this, name, scope, size, align); + addAtom(*atom); + } + + private: llvm::BumpPtrAllocator _allocator; }; |