LinkerScript: Remove leaks in the parser
authorDavid Majnemer <david.majnemer@gmail.com>
Fri, 20 Feb 2015 05:10:06 +0000 (05:10 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Fri, 20 Feb 2015 05:10:06 +0000 (05:10 +0000)
commit62ac78ae3e5e8198aaba8acaed891349b3de615f
treed8b6349da3995c76c6fa389718aa0fb8c5443f59
parente5aaf3f2cd144b978367086876f24dbe283d0f38
LinkerScript: Remove leaks in the parser

LinkerScript AST nodes are never destroyed which means that their
std::vector members will never be destroyed.

Instead, allocate the operand list itself in the Parser's
BumpPtrAllocator.  This ensures that the storage will be destroyed along
with the nodes when the Parser is destroyed.

llvm-svn: 229967
lld/include/lld/ReaderWriter/LinkerScript.h
lld/lib/ReaderWriter/LinkerScript.cpp