[Prev][Next][Index]
Re: Bug in SgStatement::insertStmtBefore()
- Date: Thu, 20 Jun 1996 16:24:23 -0500 (EST)
- From: "Dennis Gannon" <gannon@cs.indiana.edu>
- To: diego@cs.ualberta.ca, sage-bugs@rainier.extreme.indiana.edu
- Subject: Re: Bug in SgStatement::insertStmtBefore()
- Sender: owner-sage-bugs@extreme.indiana.edu
Diego,
sorry about that. actually insertStmtBefore did the correct thing
in this case, but that is not obvious!!! in fact, these insertStmt
functions give everybody a horrible time and they will be gone in
the next version. but here is the fix. there are two insertStmt functions:
libSage++.h: inline void insertStmtBefore(SgStatement &s);
libSage++.h: inline void insertStmtBefore(SgStatement &s, SgStatement &cp);
you want to use the second one. the second parameter is the control parent
of the list upon which you want your item inserted.
let cp = for_stmt->control_parent();
then do
for_stmt->insertStmtBefore(*synch, cp);
that should put it in the right place.
d.