[llvm] r268691 - [scan-build] fix warnings emitted on LLVM Hexagon code base

Krzysztof Parzyszek via llvm-commits llvm-commits at lists.llvm.org
Thu May 5 15:00:44 PDT 2016


Author: kparzysz
Date: Thu May  5 17:00:44 2016
New Revision: 268691

URL: http://llvm.org/viewvc/llvm-project?rev=268691&view=rev
Log:
[scan-build] fix warnings emitted on LLVM Hexagon code base

Patch by Apelete Seketeli.

Differential Revision: http://reviews.llvm.org/D19968

Modified:
    llvm/trunk/lib/Target/Hexagon/HexagonCFGOptimizer.cpp
    llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp
    llvm/trunk/lib/Target/Hexagon/RDFGraph.cpp

Modified: llvm/trunk/lib/Target/Hexagon/HexagonCFGOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonCFGOptimizer.cpp?rev=268691&r1=268690&r2=268691&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonCFGOptimizer.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonCFGOptimizer.cpp Thu May  5 17:00:44 2016
@@ -180,6 +180,7 @@ bool HexagonCFGOptimizer::runOnMachineFu
           // Ensure that BB2 has one instruction -- an unconditional jump.
           if ((LayoutSucc->size() == 1) &&
               IsUnconditionalJump(LayoutSucc->front().getOpcode())) {
+            assert(JumpAroundTarget && "jump target is needed to process second basic block");
             MachineBasicBlock* UncondTarget =
               LayoutSucc->front().getOperand(0).getMBB();
             // Check if the layout successor of BB2 is BB3.

Modified: llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp?rev=268691&r1=268690&r2=268691&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp Thu May  5 17:00:44 2016
@@ -1301,7 +1301,7 @@ bool HexagonInstrInfo::isPredicable(Mach
 
   // Keep a flag for upto 4 operands in the instructions, to indicate if
   // that operand has been constant extended.
-  bool OpCExtended[4];
+  bool OpCExtended[4] = {false};
   if (NumOperands > 4)
     NumOperands = 4;
 

Modified: llvm/trunk/lib/Target/Hexagon/RDFGraph.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/RDFGraph.cpp?rev=268691&r1=268690&r2=268691&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/RDFGraph.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/RDFGraph.cpp Thu May  5 17:00:44 2016
@@ -1564,6 +1564,7 @@ void DataFlowGraph::linkBlockRefs(DefSta
   // Push block delimiters.
   markBlock(BA.Id, DefM);
 
+  assert(BA.Addr && "block node address is needed to create a data-flow link");
   // For each non-phi instruction in the block, link all the defs and uses
   // to their reaching defs. For any member of the block (including phis),
   // push the defs on the corresponding stacks.




More information about the llvm-commits mailing list