]> granicus.if.org Git - llvm/commitdiff
[scan-build] fix warnings emitted on LLVM Hexagon code base
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>
Thu, 5 May 2016 22:00:44 +0000 (22:00 +0000)
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>
Thu, 5 May 2016 22:00:44 +0000 (22:00 +0000)
Patch by Apelete Seketeli.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268691 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Hexagon/HexagonCFGOptimizer.cpp
lib/Target/Hexagon/HexagonInstrInfo.cpp
lib/Target/Hexagon/RDFGraph.cpp

index eb56ae7ffb08329c0bf3ee1775749986f0724c74..78d64151b0b9e3432c10df6b6dd5d9e491927476 100644 (file)
@@ -180,6 +180,7 @@ bool HexagonCFGOptimizer::runOnMachineFunction(MachineFunction &Fn) {
           // 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.
index 0ae999239a490948be4677e8d0206e62e37ea5da..7285f698e30a1ce48a906cf944dff4d70ff719fd 100644 (file)
@@ -1301,7 +1301,7 @@ bool HexagonInstrInfo::isPredicable(MachineInstr &MI) const {
 
   // 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;
 
index 029d1e9c24ef28b17a978ab96e47adf9c33b18fd..ce3cf7b7611870559fc63f556c0fa5b25c5c3256 100644 (file)
@@ -1564,6 +1564,7 @@ void DataFlowGraph::linkBlockRefs(DefStackMap &DefM, NodeAddr<BlockNode*> BA) {
   // 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.