Skip to content

Commit

Permalink
Use a better way to insert NOP breakpoint
Browse files Browse the repository at this point in the history
previously statements serving as NOP breakpoint triggers compiler warnings. Now change it to a more informative macro that doesn't triggers warnings according to John's suggestion.
  • Loading branch information
Xuejun Yang committed May 4, 2011
1 parent efb7c6c commit 4aa53d2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/Common.h
Expand Up @@ -56,6 +56,8 @@ using namespace std ;
#define INT64 long long
#endif

#define BREAK_NOP {int i=0; i++;}

// ----------------------------------------------------------------
// Forward class declarations
class Block;
Expand Down
4 changes: 2 additions & 2 deletions src/StatementAssign.cpp
Expand Up @@ -30,7 +30,7 @@
#include "StatementAssign.h"
#include <cassert>
#include <iostream>

#include "Common.h"
#include "CGContext.h"
#include "CGOptions.h"
#include "Expression.h"
Expand Down Expand Up @@ -303,7 +303,7 @@ StatementAssign::visit_facts(vector<const Fact*>& inputs, CGContext& cg_context)
static int g = 0;
int h = g++;
if (h==57)
h = 57;
BREAK_NOP;
vector<const Fact*> inputs_copy = inputs;
// LHS and RHS can be evaludated in arbitrary order, try RHS first
Effect running_eff_context(cg_context.get_effect_context());
Expand Down
4 changes: 0 additions & 4 deletions src/StatementGoto.cpp
Expand Up @@ -219,8 +219,6 @@ StatementGoto::StatementGoto(Block* blk, const Expression &test, const Statement
}
else {
label = gensym("lbl_");
//if (label == "lbl_8")
//int g = 0;
stm_labels[dest] = label;
}
}
Expand All @@ -235,8 +233,6 @@ StatementGoto::StatementGoto(const StatementGoto &sg)
label(sg.label),
init_skipped_vars(sg.init_skipped_vars)
{
//if (label == "lbl_8")
//int g = 0;
// Nothing else to do.
}

Expand Down

0 comments on commit 4aa53d2

Please sign in to comment.