[llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c

Chris Lattner lattner at cs.uiuc.edu
Thu Nov 18 13:03:18 PST 2004



Changes in directory llvm-gcc/gcc:

llvm-expand.c updated: 1.55 -> 1.56
---
Log message:

Reduce the number of stoppoints emitted by not emitting redundant ones for
statements like:

X = 1; Y = 1;

and for stuff like:

void foo() { X = 1; }



---
Diffs of the changes:  (+13 -1)

Index: llvm-gcc/gcc/llvm-expand.c
diff -u llvm-gcc/gcc/llvm-expand.c:1.55 llvm-gcc/gcc/llvm-expand.c:1.56
--- llvm-gcc/gcc/llvm-expand.c:1.55	Thu Nov 18 14:44:23 2004
+++ llvm-gcc/gcc/llvm-expand.c	Thu Nov 18 15:03:04 2004
@@ -730,6 +730,8 @@
   llvm_instruction *dbg_call_funcstart_inst;
   llvm_value *dbg_global_memloc;
   llvm_instruction *dbg_entry_alloca;
+  int LastDebugLine, LastDebugCol;
+  llvm_basicblock *LastDebugBB;
   
 } llvm_expand_info;
 
@@ -7642,6 +7644,17 @@
   llvm_instruction *stoppoint_inst;
   llvm_instruction *load_dbg_inst;
   llvm_instruction *store_dbg_inst;
+  llvm_basicblock *CurBB = llvm_ilist_back(llvm_basicblock, Fn->BasicBlocks);
+
+  /* Do not emit two consequtive identical stoppoints. */
+  if (lineNo == Fn->ExpandInfo->LastDebugLine &&
+      colNo == Fn->ExpandInfo->LastDebugCol &&
+      CurBB == Fn->ExpandInfo->LastDebugBB)
+    return;
+
+  Fn->ExpandInfo->LastDebugLine = lineNo;
+  Fn->ExpandInfo->LastDebugCol = colNo;
+  Fn->ExpandInfo->LastDebugBB = CurBB;
 
   load_dbg_inst = create_load_inst("dbg.tmp", 
 				   Fn->ExpandInfo->dbg_global_memloc, 0);
@@ -7710,4 +7723,3 @@
   */
   
 }
-






More information about the llvm-commits mailing list