]> granicus.if.org Git - llvm/commitdiff
Fix some Clang-tidy readability-simplify-boolean-expr and Include What You Use warnings.
authorEugene Zelenko <eugene.zelenko@gmail.com>
Thu, 5 May 2016 21:35:47 +0000 (21:35 +0000)
committerEugene Zelenko <eugene.zelenko@gmail.com>
Thu, 5 May 2016 21:35:47 +0000 (21:35 +0000)
Differential revision: reviews.llvm.org/D19946

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268689 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/BitVector.h
include/llvm/ExecutionEngine/Orc/RPCChannel.h
include/llvm/Support/FileSystem.h

index 70ed2468f928698552e10b2e135ef4fe504da938..95a629126f2cc90c1f257b8dd74428b459461bd3 100644 (file)
 #ifndef LLVM_ADT_BITVECTOR_H
 #define LLVM_ADT_BITVECTOR_H
 
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/MathExtras.h"
 #include <algorithm>
 #include <cassert>
 #include <climits>
+#include <cstdint>
 #include <cstdlib>
+#include <cstring>
 
 namespace llvm {
 
@@ -69,7 +69,7 @@ public:
     }
 
     operator bool() const {
-      return ((*WordRef) & (BitWord(1) << BitPos)) ? true : false;
+      return ((*WordRef) & (BitWord(1) << BitPos)) != 0;
     }
   };
 
@@ -576,7 +576,7 @@ static inline size_t capacity_in_bytes(const BitVector &X) {
   return X.getMemorySize();
 }
 
-} // End llvm namespace
+} // end namespace llvm
 
 namespace std {
   /// Implement std::swap in terms of BitVector swap.
@@ -584,6 +584,6 @@ namespace std {
   swap(llvm::BitVector &LHS, llvm::BitVector &RHS) {
     LHS.swap(RHS);
   }
-}
+} // end namespace std
 
-#endif
+#endif // LLVM_ADT_BITVECTOR_H
index 1664e04254a7cfa3617a483b17fc5390609c873f..c569e3cf05b411243854942fb0464e8ffcf727a9 100644 (file)
@@ -1,4 +1,11 @@
-// -*- c++ -*-
+//===- llvm/ExecutionEngine/Orc/RPCChannel.h --------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
 
 #ifndef LLVM_EXECUTIONENGINE_ORC_RPCCHANNEL_H
 #define LLVM_EXECUTIONENGINE_ORC_RPCCHANNEL_H
 #include "OrcError.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Endian.h"
-
+#include "llvm/Support/Error.h"
+#include <cstddef>
+#include <cstdint>
 #include <mutex>
-#include <system_error>
+#include <string>
+#include <tuple>
+#include <vector>
 
 namespace llvm {
 namespace orc {
@@ -146,7 +158,7 @@ inline Error deserialize(RPCChannel &C, bool &V) {
   if (auto Err = C.readBytes(reinterpret_cast<char *>(&VN), 1))
     return Err;
 
-  V = (VN != 0) ? true : false;
+  V = (VN != 0);
   return Error::success();
 }
 
@@ -234,4 +246,4 @@ template <typename T> Error deserialize(RPCChannel &C, std::vector<T> &V) {
 } // end namespace orc
 } // end namespace llvm
 
-#endif
+#endif // LLVM_EXECUTIONENGINE_ORC_RPCCHANNEL_H
index 3d780236f12f06da8130afee7e571e415f83298e..b87e5709e41bc122467049546d2fce21bba31237 100644 (file)
 
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
 #include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/ErrorOr.h"
 #include "llvm/Support/TimeValue.h"
+#include <cassert>
+#include <cstdint>
 #include <ctime>
-#include <iterator>
 #include <stack>
 #include <string>
 #include <system_error>
@@ -263,7 +265,7 @@ struct file_magic {
   };
 
   bool is_object() const {
-    return V == unknown ? false : true;
+    return V != unknown;
   }
 
   file_magic() : V(unknown) {}
@@ -762,7 +764,7 @@ namespace detail {
     intptr_t IterationHandle;
     directory_entry CurrentEntry;
   };
-}
+} // end namespace detail
 
 /// directory_iterator - Iterates through the entries in path. There is no
 /// operator++ because we need an error_code. If it's really needed we can make
@@ -824,7 +826,7 @@ namespace detail {
     uint16_t Level;
     bool HasNoPushRequest;
   };
-}
+} // end namespace detail
 
 /// recursive_directory_iterator - Same as directory_iterator except for it
 /// recurses down into child directories.
@@ -923,4 +925,4 @@ public:
 } // end namespace sys
 } // end namespace llvm
 
-#endif
+#endif // LLVM_SUPPORT_FILESYSTEM_H