Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge upstream v2.105.2 #4498

Merged
merged 4 commits into from
Sep 22, 2023
Merged
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
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# LDC master

#### Big news
- Frontend, druntime and Phobos are at version [2.105.1+](https://dlang.org/changelog/2.105.0.html). (#4476)
- Frontend, druntime and Phobos are at version [2.105.2](https://dlang.org/changelog/2.105.0.html). (#4476, #4498)
- The Windows installer now supports non-admin installs *without* an explicit `/CURRENTUSER` switch. (#4495)

#### Platform support

#### Bug fixes
- ImportC:
- Fix `static` linkage. (#4484, 4487)
- Make gcc builtins available. (#4483)
- Apple: Support weird `asm("_" "<name>")` mangling stuff. (#4485, #4486)

# LDC 1.34.0 (2023-08-26)

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ include(GetLinuxDistribution)
set(LDC_VERSION "1.35.0") # May be overridden by git hash tag
set(DMDFE_MAJOR_VERSION 2)
set(DMDFE_MINOR_VERSION 105)
set(DMDFE_PATCH_VERSION 1)
set(DMDFE_PATCH_VERSION 2)

set(DMD_VERSION ${DMDFE_MAJOR_VERSION}.${DMDFE_MINOR_VERSION}.${DMDFE_PATCH_VERSION})

Expand Down
8 changes: 5 additions & 3 deletions dmd/expressionsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -11029,7 +11029,9 @@ version (IN_LLVM)
(exp.e2.isStringExp() && (exp.e1.isIntegerExp() || exp.e1.isStringExp())))
return exp;

Identifier hook = global.params.tracegc ? Id._d_arraycatnTXTrace : Id._d_arraycatnTX;
bool useTraceGCHook = global.params.tracegc && sc.needsCodegen();

Identifier hook = useTraceGCHook ? Id._d_arraycatnTXTrace : Id._d_arraycatnTX;
if (!verifyHookExist(exp.loc, *sc, hook, "concatenating arrays"))
{
setError();
Expand Down Expand Up @@ -11058,7 +11060,7 @@ version (IN_LLVM)
}

auto arguments = new Expressions();
if (global.params.tracegc)
if (useTraceGCHook)
{
auto funcname = (sc.callsc && sc.callsc.func) ?
sc.callsc.func.toPrettyChars() : sc.func.toPrettyChars();
Expand All @@ -11085,7 +11087,7 @@ version (IN_LLVM)
/* `_d_arraycatnTX` canot be used with `-betterC`, but `CatExp`s may be
* used with `-betterC`, but only during CTFE.
*/
if (global.params.betterC || !sc.needsCodegen())
if (global.params.betterC)
return;

if (auto ce = exp.isCatExp())
Expand Down
10 changes: 5 additions & 5 deletions dmd/frontend.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,8 @@ struct Loc final
{
private:
uint32_t _linnum;
uint16_t _charnum;
uint16_t fileIndex;
uint32_t _charnum;
uint32_t fileIndex;
public:
static bool showColumns;
static MessageStyle messageStyle;
Expand Down Expand Up @@ -7019,9 +7019,9 @@ struct UnionExp final
private:
union __AnonStruct__u
{
char exp[25LLU];
char exp[29LLU];
char integerexp[40LLU];
char errorexp[25LLU];
char errorexp[29LLU];
char realexp[48LLU];
char complexexp[64LLU];
char symoffexp[64LLU];
Expand All @@ -7030,7 +7030,7 @@ struct UnionExp final
char assocarrayliteralexp[48LLU];
char structliteralexp[76LLU];
char compoundliteralexp[40LLU];
char nullexp[25LLU];
char nullexp[29LLU];
char dotvarexp[49LLU];
char addrexp[40LLU];
char indexexp[74LLU];
Expand Down
4 changes: 2 additions & 2 deletions dmd/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,8 @@ struct Loc
{
private:
unsigned _linnum;
unsigned short _charnum;
unsigned short fileIndex;
unsigned _charnum;
unsigned fileIndex;
public:
static void set(bool showColumns, MessageStyle messageStyle);

Expand Down
20 changes: 14 additions & 6 deletions dmd/location.d
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ debug info etc.
struct Loc
{
private uint _linnum;
private ushort _charnum;
private ushort fileIndex; // index into filenames[], starting from 1 (0 means no filename)
private uint _charnum;
private uint fileIndex; // index into filenames[], starting from 1 (0 means no filename)
version (LocOffset)
uint fileOffset; /// utf8 code unit index relative to start of file, starting from 0

Expand Down Expand Up @@ -67,7 +67,7 @@ nothrow:
extern (D) this(const(char)* filename, uint linnum, uint charnum)
{
this._linnum = linnum;
this._charnum = cast(ushort) charnum;
this._charnum = charnum;
this.filename = filename;
}

Expand All @@ -80,7 +80,7 @@ nothrow:
/// ditto
extern (C++) uint charnum(uint num) @nogc @safe
{
return _charnum = cast(ushort) num;
return _charnum = num;
}

/// line number, starting from 1
Expand Down Expand Up @@ -114,8 +114,16 @@ nothrow:
{
//printf("setting %s\n", name);
filenames.push(name);
fileIndex = cast(ushort)filenames.length;
assert(fileIndex); // no overflow
fileIndex = cast(uint)filenames.length;
if (!fileIndex)
{
import dmd.globals : global;
import dmd.errors : error, fatal;

global.gag = 0; // ensure error message gets printed
error(Loc.initial, "internal compiler error: file name index overflow!");
fatal();
}
}
else
fileIndex = 0;
Expand Down
2 changes: 1 addition & 1 deletion packaging/dlang-tools_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.105.1
v2.105.2
2 changes: 1 addition & 1 deletion runtime/phobos
Submodule phobos updated 1 files
+65 −11 std/int128.d
15 changes: 15 additions & 0 deletions tests/dmd/compilable/test24118.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// https://issues.dlang.org/show_bug.cgi?id=24118

void map(alias fun, T)(T[] arr)
{
fun(arr);
}


void foo()
{
if( __ctfe )
{
["a", "b", "c"].map!( a => " " ~ a[0] );
}
}
Loading