Author: Zequan Wu
Date: 2023-06-15T14:46:54-04:00
New Revision: 9d910b1073198716f85e5a7e7e9c8fd1f24d4c60

URL: 
https://github.com/llvm/llvm-project/commit/9d910b1073198716f85e5a7e7e9c8fd1f24d4c60
DIFF: 
https://github.com/llvm/llvm-project/commit/9d910b1073198716f85e5a7e7e9c8fd1f24d4c60.diff

LOG: Fix test breakage in 879e88693338657aec092db749ddfcb582c65491.

Added: 
    

Modified: 
    clang/lib/Frontend/LayoutOverrideSource.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Frontend/LayoutOverrideSource.cpp 
b/clang/lib/Frontend/LayoutOverrideSource.cpp
index f09444deb8d38..f474d4fe8fdcb 100644
--- a/clang/lib/Frontend/LayoutOverrideSource.cpp
+++ b/clang/lib/Frontend/LayoutOverrideSource.cpp
@@ -152,30 +152,31 @@ LayoutOverrideSource::LayoutOverrideSource(StringRef 
Filename) {
       }
     }
 
-    // Check for the base offsets.
-    Pos = LineStr.find("BaseOffsets: [");
+    // Check for the virtual base offsets.
+    Pos = LineStr.find("VBaseOffsets: [");
     if (Pos != StringRef::npos) {
-      LineStr = LineStr.substr(Pos + strlen("BaseOffsets: ["));
+      LineStr = LineStr.substr(Pos + strlen("VBaseOffsets: ["));
       while (!LineStr.empty() && isDigit(LineStr[0])) {
         unsigned long long Offset = 0;
         if (parseUnsigned(LineStr, Offset))
-          CurrentLayout.BaseOffsets.push_back(CharUnits::fromQuantity(Offset));
+          
CurrentLayout.VBaseOffsets.push_back(CharUnits::fromQuantity(Offset));
 
         // Skip over this offset, the following comma, and any spaces.
         LineStr = LineStr.substr(1);
         while (!LineStr.empty() && isWhitespace(LineStr[0]))
           LineStr = LineStr.substr(1);
       }
+      continue;
     }
 
-    // Check for the virtual base offsets.
-    Pos = LineStr.find("VBaseOffsets: [");
+    // Check for the base offsets.
+    Pos = LineStr.find("BaseOffsets: [");
     if (Pos != StringRef::npos) {
-      LineStr = LineStr.substr(Pos + strlen("VBaseOffsets: ["));
+      LineStr = LineStr.substr(Pos + strlen("BaseOffsets: ["));
       while (!LineStr.empty() && isDigit(LineStr[0])) {
         unsigned long long Offset = 0;
         if (parseUnsigned(LineStr, Offset))
-          
CurrentLayout.VBaseOffsets.push_back(CharUnits::fromQuantity(Offset));
+          CurrentLayout.BaseOffsets.push_back(CharUnits::fromQuantity(Offset));
 
         // Skip over this offset, the following comma, and any spaces.
         LineStr = LineStr.substr(1);


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to