Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/ddmd/aggregate.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class StructDeclaration : public AggregateDeclaration
void semantic(Scope *sc);
void semanticTypeInfoMembers();
Dsymbol *search(Loc, Identifier *ident, int flags = SearchLocalsOnly);
const char *kind();
const char *kind() const;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

void finalizeSize();
bool fit(Loc loc, Scope *sc, Expressions *elements, Type *stype);
bool isPOD();
Expand All @@ -204,7 +204,7 @@ class UnionDeclaration : public StructDeclaration
{
public:
Dsymbol *syntaxCopy(Dsymbol *s);
const char *kind();
const char *kind() const;

UnionDeclaration *isUnionDeclaration() { return this; }
void accept(Visitor *v) { v->visit(this); }
Expand Down Expand Up @@ -303,7 +303,7 @@ class ClassDeclaration : public AggregateDeclaration
virtual bool isCPPinterface() const;
bool isAbstract();
virtual int vtblOffset() const;
const char *kind();
const char *kind() const;

void addLocalClass(ClassDeclarations *);

Expand All @@ -322,7 +322,7 @@ class InterfaceDeclaration : public ClassDeclaration
void semantic(Scope *sc);
bool isBaseOf(ClassDeclaration *cd, int *poffset);
bool isBaseOf(BaseClass *bc, int *poffset);
const char *kind();
const char *kind() const;
int vtblOffset() const;
bool isCPPinterface() const;
bool isCOMinterface() const;
Expand Down
2 changes: 1 addition & 1 deletion src/ddmd/aliasthis.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class AliasThis : public Dsymbol
Identifier *ident;

Dsymbol *syntaxCopy(Dsymbol *);
const char *kind();
const char *kind() const;
AliasThis *isAliasThis() { return this; }
void accept(Visitor *v) { v->visit(this); }
};
Expand Down
21 changes: 21 additions & 0 deletions src/ddmd/attrib.d
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ import ddmd.tokens;
import ddmd.semantic;
import ddmd.visitor;

version(IN_LLVM)
{
import gen.dpragma;
}


/***********************************************************
*/
extern (C++) abstract class AttribDeclaration : Dsymbol
Expand Down Expand Up @@ -806,6 +812,21 @@ extern (C++) final class PragmaDeclaration : AttribDeclaration
}
return createNewScope(sc, sc.stc, sc.linkage, sc.cppmangle, sc.protection, sc.explicitProtection, sc.aligndecl, inlining);
}
else if (IN_LLVM && ident == Id.LDC_profile_instr) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Propose a way to add pragmas to the frontend via a hook. (Maybe #7457 might be the place to put it).

bool emitInstr = true;
if (!args || args.dim != 1 || !DtoCheckProfileInstrPragma((*args)[0], emitInstr)) {
error("pragma(LDC_profile_instr, true or false) expected");
(*args)[0] = new ErrorExp();
} else {
// Only create a new scope if the emitInstrumentation flag is changed
if (sc.emitInstrumentation != emitInstr) {
auto newscope = sc.copy();
newscope.emitInstrumentation = emitInstr;
return newscope;
}
}
}

return sc;
}

Expand Down
5 changes: 3 additions & 2 deletions src/ddmd/attrib.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ class StaticIfDeclaration : public ConditionalDeclaration
void addMember(Scope *sc, ScopeDsymbol *sds);
void setScope(Scope *sc);
void importAll(Scope *sc);
void semantic(Scope *sc);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? Semantic passes should have been removed and visitor()-ized.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just a merge artefact – benign, as the function is not virtual, but fixed in master nevertheless.

const char *kind() const;
void accept(Visitor *v) { v->visit(this); }
};
Expand All @@ -199,10 +200,10 @@ class StaticForeachDeclaration : public ConditionalDeclaration
Dsymbols *cache;

Dsymbol *syntaxCopy(Dsymbol *s);
bool oneMember(Dsymbol *ps, Identifier *ident);
bool oneMember(Dsymbol **ps, Identifier *ident);
Dsymbols *include(Scope *sc, ScopeDsymbol *sds);
void addMember(Scope *sc, ScopeDsymbol *sds);
void addComment(const char *comment);
void addComment(const utf8_t *comment);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't this committed recently?

void setScope(Scope *sc);
void importAll(Scope *sc);
const char *kind() const;
Expand Down
Loading