Author: Fangrui Song
Date: 2023-06-26T12:48:20-07:00
New Revision: 5c8d24732b75002df475e2af91220b2056a06979

URL: 
https://github.com/llvm/llvm-project/commit/5c8d24732b75002df475e2af91220b2056a06979
DIFF: 
https://github.com/llvm/llvm-project/commit/5c8d24732b75002df475e2af91220b2056a06979.diff

LOG: [dataflow] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds 
after D153006

Added: 
    

Modified: 
    clang/lib/Analysis/FlowSensitive/RecordOps.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Analysis/FlowSensitive/RecordOps.cpp 
b/clang/lib/Analysis/FlowSensitive/RecordOps.cpp
index 92d9cef8ea858..b32bf35aa28fd 100644
--- a/clang/lib/Analysis/FlowSensitive/RecordOps.cpp
+++ b/clang/lib/Analysis/FlowSensitive/RecordOps.cpp
@@ -67,17 +67,15 @@ void copyRecord(AggregateStorageLocation &Src, 
AggregateStorageLocation &Dst,
 bool recordsEqual(const AggregateStorageLocation &Loc1, const Environment 
&Env1,
                   const AggregateStorageLocation &Loc2,
                   const Environment &Env2) {
-  QualType Type = Loc1.getType();
-
   LLVM_DEBUG({
     if (Loc2.getType().getCanonicalType().getUnqualifiedType() !=
-        Type.getCanonicalType().getUnqualifiedType()) {
-      llvm::dbgs() << "Loc1 type " << Type << "\n";
+        Loc1.getType().getCanonicalType().getUnqualifiedType()) {
+      llvm::dbgs() << "Loc1 type " << Loc1.getType() << "\n";
       llvm::dbgs() << "Loc2 type " << Loc2.getType() << "\n";
     }
   });
   assert(Loc2.getType().getCanonicalType().getUnqualifiedType() ==
-         Type.getCanonicalType().getUnqualifiedType());
+         Loc1.getType().getCanonicalType().getUnqualifiedType());
 
   for (auto [Field, FieldLoc1] : Loc1.children()) {
     assert(FieldLoc1 != nullptr);


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

Reply via email to