[llvm-objdump] Inverting logic to match the word "predicate". Returning true when...
authorColin LeMahieu <colinl@codeaurora.org>
Wed, 29 Jul 2015 19:21:13 +0000 (19:21 +0000)
committerColin LeMahieu <colinl@codeaurora.org>
Wed, 29 Jul 2015 19:21:13 +0000 (19:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243558 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-objdump/llvm-objdump.cpp

index 97243cb8016372a965c182195fbd8fbba2aa825b..da2e29fc8082c472f4e11d1ae6a775d15b2aa0ce 100644 (file)
@@ -202,7 +202,7 @@ public:
 
 private:
   void ScanPredicate() {
-    while (Iterator != End && Predicate(*Iterator)) {
+    while (Iterator != End && !Predicate(*Iterator)) {
       ++Iterator;
     }
   }
@@ -231,14 +231,14 @@ private:
 SectionFilter ToolSectionFilter(llvm::object::ObjectFile const &O) {
   return SectionFilter([](llvm::object::SectionRef const &S) {
                          if(FilterSections.empty())
-                           return false;
+                           return true;
                          llvm::StringRef String;
                          std::error_code error = S.getName(String);
                          if (error)
-                           return true;
+                           return false;
                          return std::find(FilterSections.begin(),
                                           FilterSections.end(),
-                                          String) == FilterSections.end();
+                                          String) != FilterSections.end();
                        },
                        O);
 }