summaryrefslogtreecommitdiff
path: root/gcc/d/dmd/module.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/d/dmd/module.h')
-rw-r--r--gcc/d/dmd/module.h59
1 files changed, 28 insertions, 31 deletions
diff --git a/gcc/d/dmd/module.h b/gcc/d/dmd/module.h
index 1664492bc2d..969290c476c 100644
--- a/gcc/d/dmd/module.h
+++ b/gcc/d/dmd/module.h
@@ -10,15 +10,16 @@
#pragma once
-#include "root/root.h"
#include "dsymbol.h"
-class ClassDeclaration;
struct ModuleDeclaration;
-struct Macro;
struct Escape;
-class VarDeclaration;
-class Library;
+struct FileBuffer;
+
+struct MacroTable
+{
+ void* internal; // PIMPL
+};
enum PKG
{
@@ -34,10 +35,9 @@ public:
unsigned tag; // auto incremented tag, used to mask package tree in scopes
Module *mod; // != NULL if isPkgMod == PKGmodule
- Package(Identifier *ident);
const char *kind() const;
- static DsymbolTable *resolve(Identifiers *packages, Dsymbol **pparent, Package **ppkg);
+ bool equals(const RootObject *o) const;
Package *isPackage() { return this; }
@@ -47,7 +47,6 @@ public:
void accept(Visitor *v) { v->visit(this); }
Module *isPackageMod();
- void resolvePKGunknown();
};
class Module : public Package
@@ -60,26 +59,31 @@ public:
static Dsymbols deferred2; // deferred Dsymbol's needing semantic2() run on them
static Dsymbols deferred3; // deferred Dsymbol's needing semantic3() run on them
static unsigned dprogress; // progress resolving the deferred list
+
static void _init();
static AggregateDeclaration *moduleinfo;
- const char *arg; // original argument name
+ DString arg; // original argument name
ModuleDeclaration *md; // if !NULL, the contents of the ModuleDeclaration declaration
- File *srcfile; // input source file
- File *objfile; // output .obj file
- File *hdrfile; // 'header' file
- File *docfile; // output documentation file
+ FileName srcfile; // input source file
+ FileName objfile; // output .obj file
+ FileName hdrfile; // 'header' file
+ FileName docfile; // output documentation file
+ FileBuffer *srcBuffer; // set during load(), free'd in parse()
unsigned errors; // if any errors in file
unsigned numlines; // number of lines in source file
- int isDocFile; // if it is a documentation input file, not D source
+ bool isHdrFile; // if it is a header (.di) file
+ bool isCFile; // if it is a C (.c) file
+ bool isDocFile; // if it is a documentation input file, not D source
+ bool hasAlwaysInlines; // contains references to functions that must be inlined
bool isPackageFile; // if it is a package.d
Package *pkg; // if isPackageFile is true, the Package that contains this package.d
Strings contentImportedFiles; // array of files whose content was imported
int needmoduleinfo;
-
int selfimports; // 0: don't know, 1: does not, 2: does
+ void* tagSymTab; // ImportC: tag symbols that conflict with other symbols used as the index
bool selfImports(); // returns true if module imports itself
int rootimports; // 0: don't know, 1: does not, 2: does
@@ -101,41 +105,34 @@ public:
unsigned debuglevel; // debug level
Identifiers *debugids; // debug identifiers
- Identifiers *debugidsNot; // forward referenced debug identifiers
+ Identifiers *debugidsNot; // forward referenced debug identifiers
unsigned versionlevel; // version level
Identifiers *versionids; // version identifiers
- Identifiers *versionidsNot; // forward referenced version identifiers
+ Identifiers *versionidsNot; // forward referenced version identifiers
- Macro *macrotable; // document comment macros
+ MacroTable macrotable; // document comment macros
Escape *escapetable; // document comment escapes
size_t nameoffset; // offset of module name from start of ModuleInfo
size_t namelen; // length of module name in characters
- Module(const char *arg, Identifier *ident, int doDocComment, int doHdrGen);
static Module* create(const char *arg, Identifier *ident, int doDocComment, int doHdrGen);
static Module *load(Loc loc, Identifiers *packages, Identifier *ident);
const char *kind() const;
- File *setOutfile(const char *name, const char *dir, const char *arg, const char *ext);
- void setDocfile();
- bool read(Loc loc); // read file, returns 'true' if succeed, 'false' otherwise.
+ bool read(const Loc &loc); // read file, returns 'true' if succeed, 'false' otherwise.
Module *parse(); // syntactic parse
void importAll(Scope *sc);
int needModuleInfo();
Dsymbol *search(const Loc &loc, Identifier *ident, int flags = SearchLocalsOnly);
- bool isPackageAccessible(Package *p, Prot protection, int flags = 0);
+ bool isPackageAccessible(Package *p, Visibility visibility, int flags = 0);
Dsymbol *symtabInsert(Dsymbol *s);
void deleteObjFile();
- static void addDeferredSemantic(Dsymbol *s);
- static void addDeferredSemantic2(Dsymbol *s);
- static void addDeferredSemantic3(Dsymbol *s);
static void runDeferredSemantic();
static void runDeferredSemantic2();
static void runDeferredSemantic3();
- static void clearCache();
int imports(Module *m);
bool isRoot() { return this->importedFrom == this; }
@@ -158,6 +155,8 @@ public:
Symbol *sfilename; // symbol for filename
+ void *ctfe_cov; // stores coverage information from ctfe
+
Module *isModule() { return this; }
void accept(Visitor *v) { v->visit(this); }
};
@@ -167,11 +166,9 @@ struct ModuleDeclaration
{
Loc loc;
Identifier *id;
- Identifiers *packages; // array of Identifier's representing packages
+ DArray<Identifier*> packages; // array of Identifier's representing packages
bool isdeprecated; // if it is a deprecated module
Expression *msg;
- ModuleDeclaration(Loc loc, Identifiers *packages, Identifier *id);
-
- const char *toChars();
+ const char *toChars() const;
};