Skip to content

Commit

Permalink
Compile Phobos with -dip1000
Browse files Browse the repository at this point in the history
  • Loading branch information
wilzbach committed Dec 9, 2017
1 parent 5a870ed commit c378941
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
6 changes: 3 additions & 3 deletions posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ $(ROOT)/%$(DOTOBJ): %.c
$(CC) -c $(CFLAGS) $< -o$@

$(LIB): $(OBJS) $(ALL_D_FILES) $(DRUNTIME)
$(DMD) $(DFLAGS) -lib -of$@ $(DRUNTIME) $(D_FILES) $(OBJS)
$(DMD) $(DFLAGS) -dip1000 -lib -of$@ $(DRUNTIME) $(D_FILES) $(OBJS)

$(ROOT)/libphobos2.so: $(ROOT)/$(SONAME)
ln -sf $(notdir $(LIBSO)) $@
Expand All @@ -322,7 +322,7 @@ $(ROOT)/$(SONAME): $(LIBSO)

$(LIBSO): override PIC:=-fPIC
$(LIBSO): $(OBJS) $(ALL_D_FILES) $(DRUNTIMESO)
$(DMD) $(DFLAGS) -shared -debuglib= -defaultlib= -of$@ -L-soname=$(SONAME) $(DRUNTIMESO) $(LINKDL) $(D_FILES) $(OBJS)
$(DMD) $(DFLAGS) -dip1000 -shared -debuglib= -defaultlib= -of$@ -L-soname=$(SONAME) $(DRUNTIMESO) $(LINKDL) $(D_FILES) $(OBJS)

ifeq (osx,$(OS))
# Build fat library that combines the 32 bit and the 64 bit libraries
Expand Down Expand Up @@ -521,7 +521,7 @@ CWS_TOCHECK = posix.mak win32.mak win64.mak
CWS_TOCHECK += $(ALL_D_FILES) index.d

checkwhitespace: $(LIB) $(TOOLS_DIR)/checkwhitespace.d
$(DMD) $(DFLAGS) -defaultlib= -debuglib= $(LIB) -run $(TOOLS_DIR)/checkwhitespace.d $(CWS_TOCHECK)
$(DMD) $(DFLAGS) -dip1000 -defaultlib= -debuglib= $(LIB) -run $(TOOLS_DIR)/checkwhitespace.d $(CWS_TOCHECK)

#############################
# Submission to Phobos are required to conform to the DStyle
Expand Down
7 changes: 3 additions & 4 deletions std/experimental/logger/core.d
Original file line number Diff line number Diff line change
Expand Up @@ -645,10 +645,9 @@ private struct MsgRange

void put(dchar elem) @safe
{
import std.utf : encode;
char[4] buffer;
size_t len = encode(buffer, elem);
log.logMsgPart(buffer[0 .. len]);
import std.utf : toUTF8;
import std.range : only;
log.logMsgPart(elem.only.toUTF8);
}
}

Expand Down
6 changes: 3 additions & 3 deletions std/uni.d
Original file line number Diff line number Diff line change
Expand Up @@ -6218,7 +6218,7 @@ auto caseEnclose(CodepointSet set)
/+
fetch codepoint set corresponding to a name (InBlock or binary property)
+/
@trusted CodepointSet getUnicodeSet(in char[] name, bool negated, bool casefold)
@trusted CodepointSet getUnicodeSet(scope const char[] name, bool negated, bool casefold)
{
CodepointSet s = unicode(name);
//FIXME: caseEnclose for new uni as Set | CaseEnclose(SET && LC)
Expand Down Expand Up @@ -7443,13 +7443,13 @@ public:
Warning: Invalidates when this Grapheme leaves the scope,
attempts to use it then would lead to memory corruption.
+/
@system SliceOverIndexed!Grapheme opSlice(size_t a, size_t b) pure nothrow @nogc
@system SliceOverIndexed!Grapheme opSlice(size_t a, size_t b) pure nothrow @nogc return
{
return sliceOverIndexed(a, b, &this);
}

/// ditto
@system SliceOverIndexed!Grapheme opSlice() pure nothrow @nogc
@system SliceOverIndexed!Grapheme opSlice() pure nothrow @nogc return
{
return sliceOverIndexed(0, length, &this);
}
Expand Down
12 changes: 12 additions & 0 deletions std/utf.d
Original file line number Diff line number Diff line change
Expand Up @@ -4024,6 +4024,7 @@ if (isSomeChar!C)

static if (isForwardRange!R)
{
static if (hasIndirections!R)
@property auto save() return scope
/* `return scope` cannot be inferred because compiler does not
* track it backwards from assignment to local `ret`
Expand All @@ -4033,6 +4034,17 @@ if (isSomeChar!C)
ret.r = r.save;
return ret;
}

static if (!hasIndirections!R)
@property auto save() scope
/* `return scope` cannot be inferred because compiler does not
* track it backwards from assignment to local `ret`
*/
{
auto ret = this;
ret.r = r.save;
return ret;
}
}

private:
Expand Down

0 comments on commit c378941

Please sign in to comment.