[Symbolize] Improve the ownership of parsed objects.
authorAlexey Samsonov <vonosmas@gmail.com>
Fri, 18 Dec 2015 22:02:14 +0000 (22:02 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Fri, 18 Dec 2015 22:02:14 +0000 (22:02 +0000)
commit9dcc66e06e5d5a2830a93aad80d5fa1e8343927a
treec964af786ca6f11abfdd72bd964d7827386b4bfb
parenta2d9f5fdfeb2d6810eefbd6339157da2b217de39
[Symbolize] Improve the ownership of parsed objects.

This code changes the way Symbolize handles parsed binaries: now
parsed OwningBinary<Binary> is not broken into (binary, memory buffer)
pair, and is just stored as-is in a cache. ObjectFile components
of Mach-O universal binaries are also stored explicitly in a
separate cache.

Additionally, this change:
* simplifies the code that parses/caches binaries: it's now done
  in a single place, not three different functions.
* makes flush() method behave as expected, and actually clear
  the cached parsed binaries and objects.
* fixes a dangling pointer issue described in
  http://reviews.llvm.org/D15638

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256041 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/DebugInfo/Symbolize/Symbolize.h
lib/DebugInfo/Symbolize/Symbolize.cpp