Permalink
Browse files

add -betterC flag

  • Loading branch information...
1 parent c667336 commit 707949edc30f245a68145bef619f6f02b85e39ab @WalterBright WalterBright committed Aug 13, 2012
Showing with 7 additions and 4 deletions.
  1. +4 −4 src/glue.c
  2. +2 −0 src/mars.c
  3. +1 −0 src/mars.h
View
@@ -446,11 +446,11 @@ void Module::genobjfile(int multiobj)
toModuleArray();
}
-#if 1 // Disable this to make 'naked' compiler that doesn't need Phobos
- // Always generate module info, because of templates and -cov
- if (1 || needModuleInfo())
+ /* Always generate module info, because of templates and -cov.
+ * But module info needs the runtime library, so disable it for betterC.
+ */
+ if (!global.params.betterC /*|| needModuleInfo()*/)
genmoduleinfo();
-#endif
// If module assert
for (int i = 0; i < 3; i++)
View
@@ -695,6 +695,8 @@ int tryMain(int argc, char *argv[])
global.params.quiet = 1;
else if (strcmp(p + 1, "release") == 0)
global.params.release = 1;
+ else if (strcmp(p + 1, "betterC") == 0)
+ global.params.betterC = 1;
#if DMDV2
else if (strcmp(p + 1, "noboundscheck") == 0)
noboundscheck = 1;
View
@@ -181,6 +181,7 @@ struct Param
char Dversion; // D version number
char ignoreUnsupportedPragmas; // rather than error on them
char enforcePropertySyntax;
+ char betterC; // be a "better C" compiler; no dependency on D runtime
char *argv0; // program name
Strings *imppath; // array of char*'s of where to look for import modules

0 comments on commit 707949e

Please sign in to comment.