Mark LDC changes and remove unused debug? switches.

The Param struct is very different between DMD and LDC. This is a start
to mark the differences. This also includes identifying unused switches
- like the debug? switches.
This commit is contained in:
kai
2012-12-17 00:08:46 +01:00
parent 6de735e578
commit ca2cc75567
2 changed files with 53 additions and 62 deletions

View File

@@ -182,40 +182,62 @@ typedef unsigned char ubyte;
// Put command line switches in here
struct Param
{
bool obj; // write object file
bool link; // perform link
bool verbose; // verbose compile
bool vtls; // identify thread local variables
ubyte symdebug; // insert debug symbolic information
bool obj; // write object file
bool link; // perform link
#if !IN_LLVM
// LDC uses a different mechanism
bool optimize; // run optimizer
char optimizeLevel; // optimization level
char dll; // generate shared dynamic library
char lib; // write library file instead of object file(s)
char multiobj; // break one object file into multiple ones
char oneobj; // write one object file instead of multiple ones
char trace; // insert profiling hooks
char quiet; // suppress non-error messages
#endif
bool verbose; // verbose compile
bool vtls; // identify thread local variables
ubyte symdebug; // insert debug symbolic information
#if !IN_LLVM
char alwaysframe; // always emit standard stack frame
char optimize; // run optimizer
#endif
ARCH cpu; // target CPU
OS os;
bool alwaysframe; // always emit standard stack frame
char map; // generate linker .map file
bool isLE; // generate little endian code
ARCH cpu; // target CPU
bool isLE; // generate little endian code
bool is64bit; // generate 64 bit code
bool useDeprecated; // allow use of deprecated features
bool useAssert; // generate runtime code for assert()'s
bool useInvariants; // generate class invariant checks
bool useIn; // generate precondition checks
bool useOut; // generate postcondition checks
bool useArrayBounds; // generate array bounds checks
bool useSwitchError; // check for switches without a default
bool useUnitTests; // generate unittest code
bool useInline; // inline expand functions
ubyte warnings; // enable warnings
ubyte Dversion; // D version number
#if !IN_LLVM
char isLinux; // generate code for linux
char isOSX; // generate code for Mac OSX
char isWindows; // generate code for Windows
char isFreeBSD; // generate code for FreeBSD
char isOPenBSD; // generate code for OpenBSD
char isSolaris; // generate code for Solaris
#else
OS os;
#endif
bool useDeprecated; // allow use of deprecated features
bool useAssert; // generate runtime code for assert()'s
bool useInvariants; // generate class invariant checks
bool useIn; // generate precondition checks
bool useOut; // generate postcondition checks
bool useArrayBounds;// generate array bounds checks
bool useSwitchError;// check for switches without a default
bool useUnitTests; // generate unittest code
bool useInline; // inline expand functions
ubyte warnings; // 0: enable warnings
// 1: warnings as errors
// 2: informational warnings (no errors)
#if !IN_LLVM
char pic; // generate position-independent-code for shared libs
char cov; // generate code coverage data
char nofloat; // code should not pull in floating point support
#endif
ubyte Dversion; // D version number
bool ignoreUnsupportedPragmas; // rather than error on them
bool enforcePropertySyntax;
char *argv0; // program name
Strings *imppath; // array of char*'s of where to look for import modules
Strings *fileImppath; // array of char*'s of where to look for file import modules
char *objdir; // .obj file output directory
char *objdir; // .obj/.lib file output directory
char *objname; // .obj file output name
bool doDocComments; // process embedded documentation comments
@@ -244,6 +266,7 @@ struct Param
char *moduleDepsFile; // filename for deps output
OutBuffer *moduleDeps; // contents to be written to deps file
#if IN_DMD
// Hidden debug switches
bool debuga;
bool debugb;
@@ -253,8 +276,13 @@ struct Param
bool debugw;
bool debugx;
bool debugy;
#endif
bool run; // run resulting executable
#if !IN_LLVM
size_t runargs_length;
char** runargs; // arguments for executable
#endif
// Linker stuff
Strings *objfiles;
@@ -484,7 +512,7 @@ typedef uint64_t StorageClass;
void warning(Loc loc, const char *format, ...) IS_PRINTF(2);
void error(Loc loc, const char *format, ...) IS_PRINTF(2);
void errorSupplemental(Loc loc, const char *format, ...);
void verror(Loc loc, const char *format, va_list, const char *p1 = NULL, const char *p2 = NULL);
void verror(Loc loc, const char *format, va_list ap, const char *p1 = NULL, const char *p2 = NULL);
void vwarning(Loc loc, const char *format, va_list);
void verrorSupplemental(Loc loc, const char *format, va_list);
void fatal();

View File

@@ -309,43 +309,6 @@ cl::opt<llvm::CodeModel::Model> mCodeModel("code-model",
clEnumValN(llvm::CodeModel::Large, "large", "Large code model"),
clEnumValEnd));
// "Hidden debug switches"
// Are these ever used?
static cl::opt<bool, true> debuga("hidden-debug--a",
cl::desc("Hidden debug option A"),
cl::ReallyHidden,
cl::location(global.params.debuga));
static cl::opt<bool, true> debugb("hidden-debug-b",
cl::desc("Hidden debug option B"),
cl::ReallyHidden,
cl::location(global.params.debugb));
static cl::opt<bool, true> debugc("hidden-debug-c",
cl::desc("Hidden debug option C"),
cl::ReallyHidden,
cl::location(global.params.debugc));
static cl::opt<bool, true> debugf("hidden-debug-f",
cl::desc("Hidden debug option F"),
cl::ReallyHidden,
cl::location(global.params.debugf));
static cl::opt<bool, true> debugr("hidden-debug-r",
cl::desc("Hidden debug option R"),
cl::ReallyHidden,
cl::location(global.params.debugr));
static cl::opt<bool, true> debugw("hidden-debug-w",
cl::desc("Hidden debug option W"),
cl::ReallyHidden,
cl::location(global.params.debugw));
static cl::opt<bool, true> debugx("hidden-debug-x",
cl::desc("Hidden debug option X"),
cl::ReallyHidden,
cl::location(global.params.debugx));
static cl::opt<bool, true> debugy("hidden-debug-y",
cl::desc("Hidden debug option Y"),
cl::ReallyHidden,
cl::location(global.params.debugy));
static cl::opt<bool, true, FlagParser> asserts("asserts",
cl::desc("(*) Enable assertions"),
cl::value_desc("bool"),