Skip to content

Commit

Permalink
dmd: Fix interface for C++ backends
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuclaw authored and dlang-bot committed Jan 10, 2025
1 parent eb910dc commit 605ca0f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler/src/dmd/common/charactertables.d
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct IdentifierCharLookup
extern(C++) bool function(dchar) isContinue;

/// Lookup the table given the table name
static IdentifierCharLookup forTable(IdentifierTable table)
extern(C++) static IdentifierCharLookup forTable(IdentifierTable table)
{
import dmd.common.identifiertables;

Expand Down
9 changes: 9 additions & 0 deletions compiler/src/dmd/common/charactertables.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,19 @@

#pragma once

enum class IdentifierTable
{
UAX31,
C99,
C11,
LR, // Least Restrictive aka All
};

struct IdentifierCharLookup final
{
bool(*isStart)(char32_t);
bool(*isContinue)(char32_t);

// constructor not provided here.
static IdentifierCharLookup forTable(IdentifierTable table);
};
6 changes: 6 additions & 0 deletions compiler/src/dmd/cxxfrontend.d
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,12 @@ MATCH leastAsSpecialized(FuncDeclaration fd, FuncDeclaration g, Identifiers* nam
return dmd.funcsem.leastAsSpecialized(fd, g, names);
}

PURE isPure(FuncDeclaration fd)
{
import dmd.funcsem;
return dmd.funcsem.isPure(fd);
}

/***********************************************************
* hdrgen.d
*/
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dmd/errors.d
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ private struct ErrorInfo
* p1 = additional message prefix
* p2 = additional message prefix
*/
private extern(C++) void verrorReport(const Loc loc, const(char)* format, va_list ap, ErrorKind kind, const(char)* p1 = null, const(char)* p2 = null)
private extern(C++) void verrorReport(const ref Loc loc, const(char)* format, va_list ap, ErrorKind kind, const(char)* p1 = null, const(char)* p2 = null)
{
return verrorReport(loc.SourceLoc, format, ap, kind, p1, p2);
}
Expand Down

0 comments on commit 605ca0f

Please sign in to comment.