diff --git a/dmd2/module.c b/dmd2/module.c index dc42b01c..dc3e2694 100644 --- a/dmd2/module.c +++ b/dmd2/module.c @@ -575,7 +575,9 @@ inline unsigned readlongBE(unsigned *p) (((unsigned char *)p)[0] << 24); } -#if IN_GCC +#if IN_LLVM +void Module::parse(bool gen_docs) +#elif IN_GCC void Module::parse(bool dump_source) #else void Module::parse() @@ -788,7 +790,11 @@ void Module::parse() d_gcc_dump_source(srcname, "d.utf-8", buf, buflen); #endif } +#if IN_LLVM + Parser p(this, buf, buflen, gen_docs); +#else Parser p(this, buf, buflen, docfile != NULL); +#endif p.nextToken(); members = p.parseModule(); md = p.md; diff --git a/dmd2/module.h b/dmd2/module.h index 9b1b20ea..af4451b0 100644 --- a/dmd2/module.h +++ b/dmd2/module.h @@ -139,7 +139,9 @@ struct Module : Package void setDocfile(); // set docfile member #endif void read(Loc loc); // read file -#if IN_GCC +#if IN_LLVM + void parse(bool gen_docs = false); // syntactic parse +#elif IN_GCC void parse(bool dump_source = false); // syntactic parse #else void parse(); // syntactic parse diff --git a/gen/main.cpp b/gen/main.cpp index 3f97f442..b96233e5 100644 --- a/gen/main.cpp +++ b/gen/main.cpp @@ -802,9 +802,13 @@ LDC_TARGETS if (!Module::rootModule) Module::rootModule = m; m->importedFrom = m; - m->buildTargetFiles(singleObj); m->read(0); +#ifdef _DH + m->parse(global.params.doDocComments); +#else m->parse(); +#endif + m->buildTargetFiles(singleObj); m->deleteObjFile(); if (m->isDocFile) {