]> granicus.if.org Git - clang/commitdiff
[CGBuiltin] dumpRecord - remove unused field offset. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 21 May 2019 10:48:42 +0000 (10:48 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 21 May 2019 10:48:42 +0000 (10:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361238 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGBuiltin.cpp

index 6a18312907359f486a74204826e1ac61261badc5..34537d3f3ef178e8aa231d065555656a4c47b65f 100644 (file)
@@ -1400,8 +1400,6 @@ static llvm::Value *dumpRecord(CodeGenFunction &CGF, QualType RType,
   const auto *RT = RType->getAs<RecordType>();
   ASTContext &Context = CGF.getContext();
   RecordDecl *RD = RT->getDecl()->getDefinition();
-  ASTContext &Ctx = RD->getASTContext();
-  const ASTRecordLayout &RL = Ctx.getASTRecordLayout(RD);
   std::string Pad = std::string(Lvl * 4, ' ');
 
   Value *GString =
@@ -1431,9 +1429,6 @@ static llvm::Value *dumpRecord(CodeGenFunction &CGF, QualType RType,
   }
 
   for (const auto *FD : RD->fields()) {
-    uint64_t Off = RL.getFieldOffset(FD->getFieldIndex());
-    Off = Ctx.toCharUnitsFromBits(Off).getQuantity();
-
     Value *FieldPtr = RecordPtr;
     if (RD->isUnion())
       FieldPtr = CGF.Builder.CreatePointerCast(