diff options
author | Frederic Riss <friss@apple.com> | 2015-06-05 20:27:04 +0000 |
---|---|---|
committer | Frederic Riss <friss@apple.com> | 2015-06-05 20:27:04 +0000 |
commit | 4d0ba668699b74479b1e020a5fdb460d65dbba6e (patch) | |
tree | 7dda0d38645010fbe32cd1cb85c837ca3f1e84e9 /llvm/tools/dsymutil/MachODebugMapParser.cpp | |
parent | 4959fda719dad29f5ab8a3e7e4da59a794609fe5 (diff) | |
download | bcm5719-llvm-4d0ba668699b74479b1e020a5fdb460d65dbba6e.tar.gz bcm5719-llvm-4d0ba668699b74479b1e020a5fdb460d65dbba6e.zip |
[dsymutil] Out-line the YAML serialization code. NFC
It will get a bit bigger in an upcoming commit. No need to have all
of that in the header.
Also move parseYAMLDebugMap() to the same place as the serialization
code. This way it will be able to share a private Context object with
it.
llvm-svn: 239185
Diffstat (limited to 'llvm/tools/dsymutil/MachODebugMapParser.cpp')
-rw-r--r-- | llvm/tools/dsymutil/MachODebugMapParser.cpp | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/llvm/tools/dsymutil/MachODebugMapParser.cpp b/llvm/tools/dsymutil/MachODebugMapParser.cpp index 14dafb4065b..ad2bf5ffa6f 100644 --- a/llvm/tools/dsymutil/MachODebugMapParser.cpp +++ b/llvm/tools/dsymutil/MachODebugMapParser.cpp @@ -242,31 +242,18 @@ void MachODebugMapParser::loadMainBinarySymbols() { } } -ErrorOr<std::unique_ptr<DebugMap>> -parseYAMLDebugMap(StringRef InputFile, StringRef PrependPath, bool Verbose) { - auto ErrOrFile = MemoryBuffer::getFileOrSTDIN(InputFile); - if (auto Err =ErrOrFile.getError()) - return Err; - - std::unique_ptr<DebugMap> Res; - yaml::Input yin((*ErrOrFile)->getBuffer(), &PrependPath); - yin >> Res; - - if (auto EC = yin.error()) - return EC; - - return std::move(Res); -} - namespace llvm { namespace dsymutil { -llvm::ErrorOr<std::unique_ptr<DebugMap>> -parseDebugMap(StringRef InputFile, StringRef PrependPath, bool Verbose, bool InputIsYAML) { + +llvm::ErrorOr<std::unique_ptr<DebugMap>> parseDebugMap(StringRef InputFile, + StringRef PrependPath, + bool Verbose, + bool InputIsYAML) { if (!InputIsYAML) { MachODebugMapParser Parser(InputFile, PrependPath, Verbose); return Parser.parse(); } else { - return parseYAMLDebugMap(InputFile, PrependPath, Verbose); + return DebugMap::parseYAMLDebugMap(InputFile, PrependPath, Verbose); } } } |