r198085 - Reduce indentation of some VFTableBuilder code.

Reid Kleckner reid at kleckner.net
Fri Dec 27 12:29:16 PST 2013


Author: rnk
Date: Fri Dec 27 14:29:16 2013
New Revision: 198085

URL: http://llvm.org/viewvc/llvm-project?rev=198085&view=rev
Log:
Reduce indentation of some VFTableBuilder code.

No functionality change.

Modified:
    cfe/trunk/lib/AST/VTableBuilder.cpp

Modified: cfe/trunk/lib/AST/VTableBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/VTableBuilder.cpp?rev=198085&r1=198084&r2=198085&view=diff
==============================================================================
--- cfe/trunk/lib/AST/VTableBuilder.cpp (original)
+++ cfe/trunk/lib/AST/VTableBuilder.cpp Fri Dec 27 14:29:16 2013
@@ -2916,30 +2916,30 @@ void VFTableBuilder::AddMethods(BaseSubo
                "Should not have method info for this method yet!");
         MethodInfoMap.insert(std::make_pair(MD, MI));
         continue;
-      } else {
-        // In case we need a return adjustment, we'll add a new slot for
-        // the overrider and put a return-adjusting thunk where the overridden
-        // method was in the vftable.
-        // For now, just mark the overriden method as shadowed by a new slot.
-        OverriddenMethodInfo.Shadowed = true;
-        ForceThunk = true;
+      }
+
+      // In case we need a return adjustment, we'll add a new slot for
+      // the overrider and put a return-adjusting thunk where the overridden
+      // method was in the vftable.
+      // For now, just mark the overriden method as shadowed by a new slot.
+      OverriddenMethodInfo.Shadowed = true;
+      ForceThunk = true;
 
-        // Also apply this adjustment to the shadowed slots.
-        if (!ThisAdjustmentOffset.isEmpty()) {
-          // FIXME: this is O(N^2), can be O(N).
-          const CXXMethodDecl *SubOverride = OverriddenMD;
-          while ((SubOverride =
-                      FindNearestOverriddenMethod(SubOverride, VisitedBases))) {
-            MethodInfoMapTy::iterator SubOverrideIterator =
-                MethodInfoMap.find(SubOverride);
-            if (SubOverrideIterator == MethodInfoMap.end())
-              break;
-            MethodInfo &SubOverrideMI = SubOverrideIterator->second;
-            assert(SubOverrideMI.Shadowed);
-            VTableThunks[SubOverrideMI.VFTableIndex].This =
-                ThisAdjustmentOffset;
-            AddThunk(MD, VTableThunks[SubOverrideMI.VFTableIndex]);
-          }
+      // Also apply this adjustment to the shadowed slots.
+      if (!ThisAdjustmentOffset.isEmpty()) {
+        // FIXME: this is O(N^2), can be O(N).
+        const CXXMethodDecl *SubOverride = OverriddenMD;
+        while ((SubOverride =
+                    FindNearestOverriddenMethod(SubOverride, VisitedBases))) {
+          MethodInfoMapTy::iterator SubOverrideIterator =
+              MethodInfoMap.find(SubOverride);
+          if (SubOverrideIterator == MethodInfoMap.end())
+            break;
+          MethodInfo &SubOverrideMI = SubOverrideIterator->second;
+          assert(SubOverrideMI.Shadowed);
+          VTableThunks[SubOverrideMI.VFTableIndex].This =
+              ThisAdjustmentOffset;
+          AddThunk(MD, VTableThunks[SubOverrideMI.VFTableIndex]);
         }
       }
     } else if (Base.getBaseOffset() != WhichVFPtr.VFPtrFullOffset ||





More information about the cfe-commits mailing list