From: George Rimar Date: Tue, 19 Feb 2019 14:22:10 +0000 (+0000) Subject: Fix BB after r354328. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6e4454157849d1d94ad5c2a863201f4ecc9d5b37;p=llvm Fix BB after r354328. Bot: http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/30188/steps/build_Lld/logs/stdio Error: /Users/buildslave/as-bldslv9_new/lld-x86_64-darwin13/llvm.src/lib/ObjectYAML/ELFYAML.cpp:1013:15: error: unused variable 'Object' [-Werror,-Wunused-variable] const auto *Object = static_cast(IO.getContext()); ^ /Users/buildslave/as-bldslv9_new/lld-x86_64-darwin13/llvm.src/lib/ObjectYAML/ELFYAML.cpp:1023:15: error: unused variable 'Object' [-Werror,-Wunused-variable] const auto *Object = static_cast(IO.getContext()); Fix: change const auto *Object = static_cast(IO.getContext()); assert(Object && "The IO context is not initialized"); to assert(!IO.getContext() && "The IO context is initialized already"); git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354329 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/ObjectYAML/ELFYAML.cpp b/lib/ObjectYAML/ELFYAML.cpp index bc73eb9d568..13c0bfdbaeb 100644 --- a/lib/ObjectYAML/ELFYAML.cpp +++ b/lib/ObjectYAML/ELFYAML.cpp @@ -1010,8 +1010,7 @@ void MappingTraits::mapping(IO &IO, void MappingTraits::mapping(IO &IO, ELFYAML::VerneedEntry &E) { - const auto *Object = static_cast(IO.getContext()); - assert(Object && "The IO context is not initialized"); + assert(!IO.getContext() && "The IO context is initialized already"); IO.mapRequired("Version", E.Version); IO.mapRequired("File", E.File); @@ -1020,8 +1019,7 @@ void MappingTraits::mapping(IO &IO, void MappingTraits::mapping(IO &IO, ELFYAML::VernauxEntry &E) { - const auto *Object = static_cast(IO.getContext()); - assert(Object && "The IO context is not initialized"); + assert(!IO.getContext() && "The IO context is initialized already"); IO.mapRequired("Name", E.Name); IO.mapRequired("Hash", E.Hash);