[dataflow] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after D153006
authorFangrui Song <i@maskray.me>
Mon, 26 Jun 2023 21:00:58 +0000 (14:00 -0700)
committerFangrui Song <i@maskray.me>
Mon, 26 Jun 2023 21:00:59 +0000 (14:00 -0700)
clang/lib/Analysis/FlowSensitive/RecordOps.cpp

index b32bf35..d7145b0 100644 (file)
@@ -19,17 +19,15 @@ namespace dataflow {
 
 void copyRecord(AggregateStorageLocation &Src, AggregateStorageLocation &Dst,
                 Environment &Env) {
-  QualType Type = Src.getType();
-
   LLVM_DEBUG({
     if (Dst.getType().getCanonicalType().getUnqualifiedType() !=
-        Type.getCanonicalType().getUnqualifiedType()) {
-      llvm::dbgs() << "Source type " << Type << "\n";
+        Src.getType().getCanonicalType().getUnqualifiedType()) {
+      llvm::dbgs() << "Source type " << Src.getType() << "\n";
       llvm::dbgs() << "Destination type " << Dst.getType() << "\n";
     }
   });
   assert(Dst.getType().getCanonicalType().getUnqualifiedType() ==
-         Type.getCanonicalType().getUnqualifiedType());
+         Src.getType().getCanonicalType().getUnqualifiedType());
 
   for (auto [Field, SrcFieldLoc] : Src.children()) {
     assert(SrcFieldLoc != nullptr);