Skip to content

Commit

Permalink
Fix up C++ headers
Browse files Browse the repository at this point in the history
  • Loading branch information
kinke committed Apr 23, 2019
1 parent 3817ab0 commit c0fc226
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 36 deletions.
5 changes: 3 additions & 2 deletions dmd/declaration.h
Expand Up @@ -597,7 +597,8 @@ class FuncDeclaration : public Declaration
bool inUnittest();
MATCH leastAsSpecialized(FuncDeclaration *g);
LabelDsymbol *searchLabel(Identifier *ident);
int getLevel(const Loc &loc, Scope *sc, FuncDeclaration *fd); // lexical nesting level difference
int getLevel(FuncDeclaration *fd, int intypeof); // lexical nesting level difference
int getLevelAndCheck(const Loc &loc, Scope *sc, FuncDeclaration *fd);
const char *toPrettyChars(bool QualifyTypes = false);
const char *toFullSignature(); // for diagnostics, e.g. 'int foo(int x, int y) pure'
bool isMain() const;
Expand Down Expand Up @@ -633,7 +634,7 @@ class FuncDeclaration : public Declaration
virtual bool addPreInvariant();
virtual bool addPostInvariant();
const char *kind() const;
FuncDeclaration *isUnique();
bool isUnique();
bool needsClosure();
bool hasNestedFrameRefs();
void buildResultVar(Scope *sc, Type *tret);
Expand Down
2 changes: 1 addition & 1 deletion dmd/dsymbol.h
Expand Up @@ -179,7 +179,7 @@ class Dsymbol : public ASTNode
static Dsymbol *create(Identifier *);
const char *toChars();
virtual const char *toPrettyCharsHelper(); // helper to print fully qualified (template) arguments
Loc& getLoc();
Loc getLoc();
const char *locToChars();
bool equals(RootObject *o);
virtual bool isAnonymous();
Expand Down
2 changes: 1 addition & 1 deletion dmd/init.h
Expand Up @@ -78,7 +78,7 @@ class ArrayInitializer : public Initializer
bool sem; // true if semantic() is run

void addInit(Expression *index, Initializer *value);
bool isAssociativeArray();
bool isAssociativeArray() const;
Expression *toAssocArrayLiteral();

void accept(Visitor *v) { v->visit(this); }
Expand Down
13 changes: 7 additions & 6 deletions dmd/mtype.h
Expand Up @@ -13,6 +13,7 @@
#include "root/rmem.h" // for d_size_t

#include "arraytypes.h"
#include "ast_node.h"
#include "globals.h"
#include "visitor.h"

Expand Down Expand Up @@ -243,7 +244,7 @@ class Type : public ASTNode
static Type *basic[TMAX];

virtual const char *kind();
Type *copy();
Type *copy() const;
virtual Type *syntaxCopy();
bool equals(RootObject *o);
bool equivalent(Type *t);
Expand All @@ -259,8 +260,8 @@ class Type : public ASTNode
virtual unsigned alignsize();
Type *trySemantic(const Loc &loc, Scope *sc);
Type *merge2();
void modToBuffer(OutBuffer *buf);
char *modToChars();
void modToBuffer(OutBuffer *buf) const;
char *modToChars() const;

virtual bool isintegral();
virtual bool isfloating(); // real, imaginary, or complex
Expand All @@ -283,7 +284,7 @@ class Type : public ASTNode
bool isWildConst() const { return (mod & MODwildconst) == MODwildconst; }
bool isSharedWild() const { return (mod & (MODshared | MODwild)) == (MODshared | MODwild); }
bool isNaked() const { return mod == 0; }
Type *nullAttributes();
Type *nullAttributes() const;
Type *constOf();
Type *immutableOf();
Type *mutableOf();
Expand Down Expand Up @@ -857,7 +858,7 @@ class TypeNull : public Type

//enum InOut { None, In, Out, InOut, Lazy };

class Parameter : public RootObject
class Parameter : public ASTNode
{
public:
//enum InOut inout;
Expand All @@ -873,7 +874,7 @@ class Parameter : public RootObject
Type *isLazyArray();
// kludge for template.isType()
DYNCAST dyncast() const { return DYNCAST_PARAMETER; }
virtual void accept(Visitor *v) { v->visit(this); }
void accept(Visitor *v) { v->visit(this); }

static size_t dim(Parameters *parameters);
static Parameter *getNth(Parameters *parameters, d_size_t nth, d_size_t *pn = NULL);
Expand Down
3 changes: 2 additions & 1 deletion dmd/root/rmem.h
Expand Up @@ -34,8 +34,9 @@ struct Mem
static void error();

#if 1 // version (GC)
static bool isGCEnabled;
static bool _isGCEnabled;

static bool isGCEnabled();
static void disableGC();
static void addRange(const void *p, d_size_t size);
static void removeRange(const void *p);
Expand Down
46 changes: 23 additions & 23 deletions dmd/statement.h
Expand Up @@ -83,8 +83,8 @@ class Statement : public ASTNode
void warning(const char *format, ...);
void deprecation(const char *format, ...);
virtual Statement *getRelatedLabeled() { return this; }
virtual bool hasBreak();
virtual bool hasContinue();
virtual bool hasBreak() const;
virtual bool hasContinue() const;
bool usesEH();
bool comeFrom();
bool hasCode();
Expand Down Expand Up @@ -208,8 +208,8 @@ class UnrolledLoopStatement : public Statement
Statements *statements;

Statement *syntaxCopy();
bool hasBreak();
bool hasContinue();
bool hasBreak() const;
bool hasContinue() const;

void accept(Visitor *v) { v->visit(this); }
};
Expand All @@ -223,8 +223,8 @@ class ScopeStatement : public Statement
Statement *syntaxCopy();
ScopeStatement *isScopeStatement() { return this; }
ReturnStatement *isReturnStatement();
bool hasBreak();
bool hasContinue();
bool hasBreak() const;
bool hasContinue() const;

void accept(Visitor *v) { v->visit(this); }
};
Expand All @@ -248,8 +248,8 @@ class WhileStatement : public Statement
Loc endloc; // location of closing curly bracket

Statement *syntaxCopy();
bool hasBreak();
bool hasContinue();
bool hasBreak() const;
bool hasContinue() const;

void accept(Visitor *v) { v->visit(this); }
};
Expand All @@ -262,8 +262,8 @@ class DoStatement : public Statement
Loc endloc; // location of ';' after while

Statement *syntaxCopy();
bool hasBreak();
bool hasContinue();
bool hasBreak() const;
bool hasContinue() const;

void accept(Visitor *v) { v->visit(this); }
};
Expand All @@ -285,8 +285,8 @@ class ForStatement : public Statement
Statement *syntaxCopy();
Statement *scopeCode(Scope *sc, Statement **sentry, Statement **sexit, Statement **sfinally);
Statement *getRelatedLabeled() { return relatedLabeled ? relatedLabeled : this; }
bool hasBreak();
bool hasContinue();
bool hasBreak() const;
bool hasContinue() const;

void accept(Visitor *v) { v->visit(this); }
};
Expand All @@ -309,8 +309,8 @@ class ForeachStatement : public Statement
ScopeStatements *gotos; // forward referenced goto's go here

Statement *syntaxCopy();
bool hasBreak();
bool hasContinue();
bool hasBreak() const;
bool hasContinue() const;

void accept(Visitor *v) { v->visit(this); }
};
Expand All @@ -328,8 +328,8 @@ class ForeachRangeStatement : public Statement
VarDeclaration *key;

Statement *syntaxCopy();
bool hasBreak();
bool hasContinue();
bool hasBreak() const;
bool hasContinue() const;

void accept(Visitor *v) { v->visit(this); }
};
Expand Down Expand Up @@ -416,7 +416,7 @@ class SwitchStatement : public Statement
#endif

Statement *syntaxCopy();
bool hasBreak();
bool hasBreak() const;

void accept(Visitor *v) { v->visit(this); }
};
Expand Down Expand Up @@ -555,8 +555,8 @@ class SynchronizedStatement : public Statement
Statement *_body;

Statement *syntaxCopy();
bool hasBreak();
bool hasContinue();
bool hasBreak() const;
bool hasContinue() const;

void accept(Visitor *v) { v->visit(this); }
};
Expand All @@ -581,7 +581,7 @@ class TryCatchStatement : public Statement
Catches *catches;

Statement *syntaxCopy();
bool hasBreak();
bool hasBreak() const;

void accept(Visitor *v) { v->visit(this); }
};
Expand All @@ -592,9 +592,9 @@ class Catch : public RootObject
Loc loc;
Type *type;
Identifier *ident;
VarDeclaration *var;
Statement *handler;

VarDeclaration *var;
// set if semantic processing errors
bool errors;

Expand All @@ -615,8 +615,8 @@ class TryFinallyStatement : public Statement

static TryFinallyStatement *create(Loc loc, Statement *body, Statement *finalbody);
Statement *syntaxCopy();
bool hasBreak();
bool hasContinue();
bool hasBreak() const;
bool hasContinue() const;

void accept(Visitor *v) { v->visit(this); }
};
Expand Down
4 changes: 2 additions & 2 deletions dmd/template.h
Expand Up @@ -105,7 +105,7 @@ class TemplateDeclaration : public ScopeDsymbol
* For this-parameter:
* template Foo(this ident)
*/
class TemplateParameter : public RootObject
class TemplateParameter : public ASTNode
{
public:
Loc loc;
Expand Down Expand Up @@ -142,7 +142,7 @@ class TemplateParameter : public RootObject
/* Create dummy argument based on parameter.
*/
virtual void *dummyArg() = 0;
virtual void accept(Visitor *v) { v->visit(this); }
void accept(Visitor *v) { v->visit(this); }
};

/* Syntax:
Expand Down

0 comments on commit c0fc226

Please sign in to comment.