Merge branch 'master' into c1p
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2012, Ullrich von Bassewitz */
|
||||
/* (C) 1998-2013, Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <errno.h>
|
||||
|
||||
/* common */
|
||||
#include "cmdline.h"
|
||||
#include "exprdefs.h"
|
||||
#include "libdefs.h"
|
||||
#include "print.h"
|
||||
@@ -60,7 +61,7 @@
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
/* Name of the library file */
|
||||
const char* LibName = 0;
|
||||
|
||||
@@ -101,7 +102,7 @@ static void ReadHeader (void)
|
||||
}
|
||||
Header.Flags = Read16 (Lib);
|
||||
Header.IndexOffs = Read32 (Lib);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -229,7 +230,9 @@ void LibOpen (const char* Name, int MustExist, int NeedTemp)
|
||||
if (MustExist) {
|
||||
Error ("Library `%s' does not exist", Name);
|
||||
} else {
|
||||
Warning ("Library `%s' not found - will be created", Name);
|
||||
/* Announce the library's creation if ar65 is verbose. */
|
||||
Print (stdout, 1,
|
||||
"%s: Library `%s' will be created.\n", ProgName, Name);
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -307,7 +310,7 @@ static void LibCheckExports (ObjData* O)
|
||||
unsigned I;
|
||||
|
||||
/* Let the user know what we do */
|
||||
Print (stdout, 1, "Module `%s' (%u exports):\n", O->Name, CollCount (&O->Exports));
|
||||
Print (stdout, 2, "Module `%s' (%u exports):\n", O->Name, CollCount (&O->Exports));
|
||||
|
||||
/* Insert the exports into the global table */
|
||||
for (I = 0; I < CollCount (&O->Exports); ++I) {
|
||||
@@ -316,7 +319,7 @@ static void LibCheckExports (ObjData* O)
|
||||
const char* Name = CollConstAt (&O->Exports, I);
|
||||
|
||||
/* Insert the name into the hash table */
|
||||
Print (stdout, 1, " %s\n", Name);
|
||||
Print (stdout, 2, " %s\n", Name);
|
||||
ExpInsert (Name, O);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2012, Ullrich von Bassewitz */
|
||||
/* (C) 1998-2013, Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
@@ -60,11 +60,12 @@
|
||||
static void Usage (void)
|
||||
/* Print usage information and exit */
|
||||
{
|
||||
printf ("Usage: %s <operation> lib file|module ...\n"
|
||||
"Operation is one of:\n"
|
||||
fprintf (stderr, "Usage: %s <operation ...> lib file|module ...\n"
|
||||
"Operations are some of:\n"
|
||||
"\ta\tAdd modules\n"
|
||||
"\td\tDelete modules\n"
|
||||
"\tl\tList library contents\n"
|
||||
"\tv\tIncrease verbosity (put before other operation)\n"
|
||||
"\tx\tExtract modules\n"
|
||||
"\tV\tPrint the archiver version\n",
|
||||
ProgName);
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 2001-2009 Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* (C) 2001-2013, Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
/* */
|
||||
/* This software is provided 'as-is', without any expressed or implied */
|
||||
@@ -58,7 +58,8 @@ typedef enum {
|
||||
LI_DIRECT = 0x01, /* Direct op may be used */
|
||||
LI_RELOAD_Y = 0x02, /* Reload index register Y */
|
||||
LI_REMOVE = 0x04, /* Load may be removed */
|
||||
LI_DUP_LOAD = 0x08, /* Duplicate load */
|
||||
LI_DONT_REMOVE = 0x08, /* Load may not be removed */
|
||||
LI_DUP_LOAD = 0x10, /* Duplicate load */
|
||||
} LI_FLAGS;
|
||||
|
||||
/* Structure that tells us how to load the lhs values */
|
||||
@@ -245,6 +246,18 @@ static void AdjustLoadInfo (LoadInfo* LI, int Index, int Change)
|
||||
|
||||
|
||||
|
||||
static void HonourUseAndChg (LoadRegInfo* RI, unsigned Reg, const CodeEntry* E)
|
||||
/* Honour use and change flags for an instruction */
|
||||
{
|
||||
if (E->Chg & Reg) {
|
||||
ClearLoadRegInfo (RI);
|
||||
} else if ((E->Use & Reg) && RI->LoadIndex >= 0) {
|
||||
RI->Flags |= LI_DONT_REMOVE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void TrackLoads (LoadInfo* LI, CodeEntry* E, int I)
|
||||
/* Track loads for a code entry */
|
||||
{
|
||||
@@ -349,15 +362,9 @@ static void TrackLoads (LoadInfo* LI, CodeEntry* E, int I)
|
||||
|
||||
ClearLoadRegInfo (&LI->Y);
|
||||
} else {
|
||||
if (E->Chg & REG_A) {
|
||||
ClearLoadRegInfo (&LI->A);
|
||||
}
|
||||
if (E->Chg & REG_X) {
|
||||
ClearLoadRegInfo (&LI->X);
|
||||
}
|
||||
if (E->Chg & REG_Y) {
|
||||
ClearLoadRegInfo (&LI->Y);
|
||||
}
|
||||
HonourUseAndChg (&LI->A, REG_A, E);
|
||||
HonourUseAndChg (&LI->X, REG_X, E);
|
||||
HonourUseAndChg (&LI->Y, REG_Y, E);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -646,7 +653,7 @@ static void RemoveRegLoads (StackOpData* D, LoadInfo* LI)
|
||||
/* Both registers may be loaded with one insn, but DelEntry will in this
|
||||
* case clear the other one.
|
||||
*/
|
||||
if (LI->A.Flags & LI_REMOVE) {
|
||||
if ((LI->A.Flags & (LI_REMOVE | LI_DONT_REMOVE)) == LI_REMOVE) {
|
||||
if (LI->A.LoadIndex >= 0) {
|
||||
DelEntry (D, LI->A.LoadIndex);
|
||||
}
|
||||
@@ -654,7 +661,7 @@ static void RemoveRegLoads (StackOpData* D, LoadInfo* LI)
|
||||
DelEntry (D, LI->A.XferIndex);
|
||||
}
|
||||
}
|
||||
if (LI->X.Flags & LI_REMOVE) {
|
||||
if ((LI->X.Flags & (LI_REMOVE | LI_DONT_REMOVE)) == LI_REMOVE) {
|
||||
if (LI->X.LoadIndex >= 0) {
|
||||
DelEntry (D, LI->X.LoadIndex);
|
||||
}
|
||||
@@ -875,7 +882,7 @@ static unsigned Opt_tosshift (StackOpData* D, const char* Name)
|
||||
AddStoreA (D);
|
||||
|
||||
/* Be sure to setup IP after adding the stores, otherwise it will get
|
||||
* messed up.
|
||||
* messed up.
|
||||
*/
|
||||
D->IP = D->OpIndex+1;
|
||||
|
||||
|
||||
@@ -1952,6 +1952,7 @@ static void hie_internal (const GenDesc* Ops, /* List of generators */
|
||||
type = CF_CONST;
|
||||
if ((Gen->Flags & GEN_NOPUSH) == 0) {
|
||||
g_push (ltype, 0);
|
||||
} else {
|
||||
ltype |= CF_REG; /* Value is in register */
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,6 @@ static void Usage (void)
|
||||
" --config name\t\tUse linker config file\n"
|
||||
" --dbgfile name\tGenerate debug information\n"
|
||||
" --define sym=val\tDefine a symbol\n"
|
||||
" --dump-config name\tDump a builtin configuration\n"
|
||||
" --end-group\t\tEnd a library group\n"
|
||||
" --force-import sym\tForce an import of symbol `sym'\n"
|
||||
" --help\t\tHelp (this text)\n"
|
||||
|
||||
Reference in New Issue
Block a user