[llvm] r354329 - Fix BB after r354328.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 19 06:22:10 PST 2019
Author: grimar
Date: Tue Feb 19 06:22:10 2019
New Revision: 354329
URL: http://llvm.org/viewvc/llvm-project?rev=354329&view=rev
Log:
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<ELFYAML::Object *>(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<ELFYAML::Object *>(IO.getContext());
Fix:
change
const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
assert(Object && "The IO context is not initialized");
to
assert(!IO.getContext() && "The IO context is initialized already");
Modified:
llvm/trunk/lib/ObjectYAML/ELFYAML.cpp
Modified: llvm/trunk/lib/ObjectYAML/ELFYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ObjectYAML/ELFYAML.cpp?rev=354329&r1=354328&r2=354329&view=diff
==============================================================================
--- llvm/trunk/lib/ObjectYAML/ELFYAML.cpp (original)
+++ llvm/trunk/lib/ObjectYAML/ELFYAML.cpp Tue Feb 19 06:22:10 2019
@@ -1010,8 +1010,7 @@ void MappingTraits<ELFYAML::DynamicEntry
void MappingTraits<ELFYAML::VerneedEntry>::mapping(IO &IO,
ELFYAML::VerneedEntry &E) {
- const auto *Object = static_cast<ELFYAML::Object *>(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<ELFYAML::VerneedEntry
void MappingTraits<ELFYAML::VernauxEntry>::mapping(IO &IO,
ELFYAML::VernauxEntry &E) {
- const auto *Object = static_cast<ELFYAML::Object *>(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);
More information about the llvm-commits
mailing list