[llvm] dfec4ef - Use object directly instead of accessing ArrayRef (#83263)

via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 1 05:45:47 PST 2024


Author: Martin Wehking
Date: 2024-03-01T19:15:42+05:30
New Revision: dfec4ef1a2ff8dc6685594813bcf14c27db9d5bc

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

LOG: Use object directly instead of accessing ArrayRef (#83263)

Use RegOp directly inside debug code to silence a static analyzer that
warns about accessing it through its ArrayRef wrapper.

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/AMDGPUMachineCFGStructurizer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/AMDGPUMachineCFGStructurizer.cpp b/llvm/lib/Target/AMDGPU/AMDGPUMachineCFGStructurizer.cpp
index 9dade7442c3566..e2678e8336c569 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUMachineCFGStructurizer.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUMachineCFGStructurizer.cpp
@@ -2292,7 +2292,7 @@ MachineBasicBlock *AMDGPUMachineCFGStructurizer::createIfRegion(
             MachineOperand::CreateReg(Reg, false, false, true);
         ArrayRef<MachineOperand> Cond(RegOp);
         LLVM_DEBUG(dbgs() << "RegionExitReg: ");
-        LLVM_DEBUG(Cond[0].print(dbgs(), TRI));
+        LLVM_DEBUG(RegOp.print(dbgs(), TRI));
         LLVM_DEBUG(dbgs() << "\n");
         TII->insertBranch(*RegionExit, CurrentRegion->getEntry(), RegionExit,
                           Cond, DebugLoc());


        


More information about the llvm-commits mailing list