- Change optimize() function to return void.
- Pass LCLint.
svn path=/trunk/yasm/; revision=447
* This function takes the unoptimized linked list of sections and returns
* an optimized linked list of sections ready for output to an object file.
*/
- sectionhead *(*optimize) (sectionhead *sections);
+ void (*optimize) (sectionhead *sections);
};
/* Available optimizers */
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "util.h"
-RCSID("$IdPath$");
+/*@unused@*/ RCSID("$IdPath$");
#include "symrec.h"
#include "optimizer.h"
-#define SECTFLAG_NONE 0
-#define SECTFLAG_INPROGRESS (1<<0)
-#define SECTFLAG_DONE (1<<1)
+#define SECTFLAG_NONE 0UL
+#define SECTFLAG_INPROGRESS (1UL<<0)
+#define SECTFLAG_DONE (1UL<<1)
-#define BCFLAG_NONE 0
-#define BCFLAG_INPROGRESS (1<<0)
-#define BCFLAG_DONE (1<<1)
+#define BCFLAG_NONE 0UL
+#define BCFLAG_INPROGRESS (1UL<<0)
+#define BCFLAG_DONE (1UL<<1)
static /*@only@*/ /*@null@*/ intnum *
basic_optimize_resolve_label(symrec *sym)
{
unsigned long flags;
+ /*@dependent@*/ section *sect;
+ /*@dependent@*/ /*@null@*/ bytecode *bc;
+
+ if (!symrec_get_label(sym, §, &bc))
+ return NULL;
flags = symrec_get_opt_flags(sym);
return 1;
}
-static sectionhead *
+static void
basic_optimize(sectionhead *sections)
{
/* Optimization process: (essentially NASM's pass 1)
sections_traverse(sections, NULL, basic_optimize_section);
/* NASM's pass 2 is output, so we just return. */
- return sections;
}
/* Define optimizer structure -- see optimizer.h for details */
* This function takes the unoptimized linked list of sections and returns
* an optimized linked list of sections ready for output to an object file.
*/
- sectionhead *(*optimize) (sectionhead *sections);
+ void (*optimize) (sectionhead *sections);
};
/* Available optimizers */
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "util.h"
-RCSID("$IdPath$");
+/*@unused@*/ RCSID("$IdPath$");
#include "symrec.h"
#include "optimizer.h"
-#define SECTFLAG_NONE 0
-#define SECTFLAG_INPROGRESS (1<<0)
-#define SECTFLAG_DONE (1<<1)
+#define SECTFLAG_NONE 0UL
+#define SECTFLAG_INPROGRESS (1UL<<0)
+#define SECTFLAG_DONE (1UL<<1)
-#define BCFLAG_NONE 0
-#define BCFLAG_INPROGRESS (1<<0)
-#define BCFLAG_DONE (1<<1)
+#define BCFLAG_NONE 0UL
+#define BCFLAG_INPROGRESS (1UL<<0)
+#define BCFLAG_DONE (1UL<<1)
static /*@only@*/ /*@null@*/ intnum *
basic_optimize_resolve_label(symrec *sym)
{
unsigned long flags;
+ /*@dependent@*/ section *sect;
+ /*@dependent@*/ /*@null@*/ bytecode *bc;
+
+ if (!symrec_get_label(sym, §, &bc))
+ return NULL;
flags = symrec_get_opt_flags(sym);
return 1;
}
-static sectionhead *
+static void
basic_optimize(sectionhead *sections)
{
/* Optimization process: (essentially NASM's pass 1)
sections_traverse(sections, NULL, basic_optimize_section);
/* NASM's pass 2 is output, so we just return. */
- return sections;
}
/* Define optimizer structure -- see optimizer.h for details */