[LLVMSymbolize] Move ModuleInfo into a separate class (SymbolizableModule).
authorAlexey Samsonov <vonosmas@gmail.com>
Thu, 29 Oct 2015 22:21:37 +0000 (22:21 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Thu, 29 Oct 2015 22:21:37 +0000 (22:21 +0000)
commit32e078b09cc544366720bd0e62119c8197893100
tree75feb6d40e9e2de65b38f3a902efe2ea8451bbf8
parentd97fb0831c3facac942d62062b571054825532df
[LLVMSymbolize] Move ModuleInfo into a separate class (SymbolizableModule).

Summary:
This is mostly NFC. It is a first step in cleaning up LLVMSymbolize
library. It removes "ModuleInfo" class which bundles together ObjectFile
and its debug info context in favor of:
  * abstract SymbolizableModule in public headers;
  * SymbolizableObjectFile subclass in implementation.

Additionally, SymbolizableObjectFile is now created via factory, so we
can properly detect object parsing error at this stage instead of keeping
the broken half-parsed object. As a next step, we would be able to
propagate the error all the way back to the library user.

Further improvements might include:
  * factoring out the logic of finding appropriate file with debug info
    for a given object file, and caching all parsed object files into a
    separate class [A].
  * factoring out DILineInfo rendering [B].
This would make what is now a heavyweight "LLVMSymbolizer" a relatively
straightforward class, that calls into [A] to turn filepath into a
SymbolizableModule, delegates actual symbolization to concrete SymbolizableModule
implementation, and lets [C] render the result.

Reviewers: dblaikie, echristo, rafael

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D14099

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251662 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/DebugInfo/Symbolize/SymbolizableModule.h [new file with mode: 0644]
include/llvm/DebugInfo/Symbolize/Symbolize.h
lib/DebugInfo/Symbolize/CMakeLists.txt
lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp [new file with mode: 0644]
lib/DebugInfo/Symbolize/SymbolizableObjectFile.h [new file with mode: 0644]
lib/DebugInfo/Symbolize/Symbolize.cpp