[llvm-commits] CVS: reopt/lib/LightWtProfiling/SLI.cpp SecondTrigger.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Thu Sep 23 12:48:45 PDT 2004



Changes in directory reopt/lib/LightWtProfiling:

SLI.cpp updated: 1.22 -> 1.23
SecondTrigger.cpp updated: 1.34 -> 1.35
---
Log message:

Fix assertions with important side-effects.


---
Diffs of the changes:  (+8 -6)

Index: reopt/lib/LightWtProfiling/SLI.cpp
diff -u reopt/lib/LightWtProfiling/SLI.cpp:1.22 reopt/lib/LightWtProfiling/SLI.cpp:1.23
--- reopt/lib/LightWtProfiling/SLI.cpp:1.22	Thu Sep  2 11:55:44 2004
+++ reopt/lib/LightWtProfiling/SLI.cpp	Thu Sep 23 14:48:34 2004
@@ -213,8 +213,8 @@
   // a BasicBlock, but since branchAddr ends a basic block, we must scan 
   // backwards hoping to find the beginning of its basic block.
   BasicBlock *root = 0, *end = 0;
-  assert(getReverseBBMap(brTarget, M, root)
-         && "Branch target's BasicBlock not found in map!");
+  bool foundBB = getReverseBBMap(brTarget, M, root);
+  assert(foundBB && "Branch target's BasicBlock not found in map!");
   assert(root && "Branch target mapped to NULL BasicBlock?");
   while(!getReverseBBMap(branchAddr, M, end))
     branchAddr -= 4; // Scan backwards until we find it.
@@ -372,7 +372,8 @@
 
             } else{
               BasicBlock *targetBB=NULL;
-              assert(getReverseBBMap(getBranchTarget(instr, addr), M, targetBB));
+              bool found = getReverseBBMap(getBranchTarget(instr, addr), M, targetBB);
+              assert(found);
               branchStub[index] = targetBB;
             }
             index += 2;
@@ -569,7 +570,8 @@
 	trace.push_back(vm->readInstrFrmVm(addr+4, tr, tr2));
         if (isBranchAlways(instr)) {
           BasicBlock *targetBB = NULL;
-          assert(getReverseBBMap(getBranchTarget(instr, addr), M, targetBB));
+          bool found = getReverseBBMap(getBranchTarget(instr, addr), M, targetBB);
+          assert(found);
           branchStub[index] = targetBB;
           index += 2;
         } else if (isCondBranch) {


Index: reopt/lib/LightWtProfiling/SecondTrigger.cpp
diff -u reopt/lib/LightWtProfiling/SecondTrigger.cpp:1.34 reopt/lib/LightWtProfiling/SecondTrigger.cpp:1.35
--- reopt/lib/LightWtProfiling/SecondTrigger.cpp:1.34	Thu Sep  2 11:55:44 2004
+++ reopt/lib/LightWtProfiling/SecondTrigger.cpp	Thu Sep 23 14:48:34 2004
@@ -438,8 +438,8 @@
   BasicBlock *bb;
   BasicBlock *startBB = 0;
   // Get the first basic block by querying the mapping information.
-  assert (getReverseBBMap (start, M, startBB) &&
-	  "Couldn't find starting BasicBlock for trace start addr");
+  bool foundBB = getReverseBBMap (start, M, startBB);
+  assert (foundBB && "Couldn't find starting BasicBlock for trace start addr");
   bb = startBB;
   do {
     // Add basic block to trace.






More information about the llvm-commits mailing list