Still need to figure out how to correctly get the filename/lineno for
functions that have an entry block with no first_stmt.
source_location orig_loc;
/* Remember the source location in the original first block. */
- cur_bb = ENTRY_BLOCK_PTR_FOR_FUNCTION (cfun);
- orig_loc = gimple_location (first_stmt (cur_bb->next_bb));
+ {
+ basic_block bb;
+ gimple stmt;
+
+ bb = ENTRY_BLOCK_PTR_FOR_FUNCTION (cfun);
+ stmt = first_stmt (bb->next_bb);
+ if (stmt != NULL)
+ orig_loc = gimple_location (first_stmt (bb->next_bb));
+ else
+ orig_loc = 0;
+ }
bb_pairs = VEC_alloc (bb_pair, gc, INITIAL_PAIRS);
label_pairs = VEC_alloc (label_pair, heap, INITIAL_PAIRS);
{
basic_block bb;
expanded_location xloc;
-
+ gimple stmt;
+
+ /* TODO: How do we figure out the line number and file number when
+ their is no first_stmt? */
bb = ENTRY_BLOCK_PTR_FOR_FUNCTION (cfun);
- xloc = expand_location (gimple_location (first_stmt (bb->next_bb)));
+ stmt = first_stmt (bb->next_bb);
+ if (stmt != NULL)
+ {
+ xloc = expand_location (gimple_location (stmt));
+ }
+ else
+ {
+ xloc.line = 0;
+ xloc.file = NULL;
+ }
+
return xloc;
}