]> granicus.if.org Git - llvm/commitdiff
[Support] clang-format LEB128.h. NFC.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Thu, 27 Apr 2017 02:09:42 +0000 (02:09 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Thu, 27 Apr 2017 02:09:42 +0000 (02:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301509 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/LEB128.h

index ff775f3b7b364d8415c3dc94a0fa87efe4d3e994..a2bcef81bee6304fa282395321a4d840c30e60b0 100644 (file)
@@ -45,8 +45,7 @@ inline void encodeSLEB128(int64_t Value, raw_ostream &OS,
 
 /// Utility function to encode a SLEB128 value to a buffer. Returns
 /// the length in bytes of the encoded value.
-inline unsigned encodeSLEB128(int64_t Value, uint8_t *p,
-                              unsigned Padding = 0) {
+inline unsigned encodeSLEB128(int64_t Value, uint8_t *p, unsigned Padding = 0) {
   uint8_t *orig_p = p;
   bool More;
   do {
@@ -111,7 +110,6 @@ inline unsigned encodeULEB128(uint64_t Value, uint8_t *p,
   return (unsigned)(p - orig_p);
 }
 
-
 /// Utility function to decode a ULEB128 value.
 inline uint64_t decodeULEB128(const uint8_t *p, unsigned *n = nullptr,
                               const uint8_t *end = nullptr,
@@ -119,19 +117,19 @@ inline uint64_t decodeULEB128(const uint8_t *p, unsigned *n = nullptr,
   const uint8_t *orig_p = p;
   uint64_t Value = 0;
   unsigned Shift = 0;
-  if(error)
+  if (error)
     *error = nullptr;
   do {
-    if(end && p == end){
-      if(error)
+    if (end && p == end) {
+      if (error)
         *error = "malformed uleb128, extends past end";
       if (n)
         *n = (unsigned)(p - orig_p);
       return 0;
     }
     uint64_t Slice = *p & 0x7f;
-    if(Shift >= 64 || Slice << Shift >> Shift != Slice){
-      if(error)
+    if (Shift >= 64 || Slice << Shift >> Shift != Slice) {
+      if (error)
         *error = "uleb128 too big for uint64";
       if (n)
         *n = (unsigned)(p - orig_p);
@@ -154,8 +152,8 @@ inline int64_t decodeSLEB128(const uint8_t *p, unsigned *n = nullptr,
   unsigned Shift = 0;
   uint8_t Byte;
   do {
-    if(end && p == end){
-      if(error)
+    if (end && p == end) {
+      if (error)
         *error = "malformed sleb128, extends past end";
       if (n)
         *n = (unsigned)(p - orig_p);
@@ -173,13 +171,12 @@ inline int64_t decodeSLEB128(const uint8_t *p, unsigned *n = nullptr,
   return Value;
 }
 
-
 /// Utility function to get the size of the ULEB128-encoded value.
 extern unsigned getULEB128Size(uint64_t Value);
 
 /// Utility function to get the size of the SLEB128-encoded value.
 extern unsigned getSLEB128Size(int64_t Value);
 
-}  // namespace llvm
+} // namespace llvm
 
-#endif  // LLVM_SYSTEM_LEB128_H
+#endif // LLVM_SYSTEM_LEB128_H