Commit 497cb612 authored by ian@well-typed.com's avatar ian@well-typed.com
Browse files

Merge branch 'master' of http://darcs.haskell.org/ghc

parents ecd96761 d6841149
......@@ -324,17 +324,15 @@ canDoGenerics1_w rep_tc
representable ty = case tcSplitTyConApp_maybe ty of
Nothing -> return Nothing
-- if it's a type constructor, it has to be representable
Just (tc, tc_args) -> do
Just (tc, _) -> do
let n = tyConName tc
s <- S.get
-- internally assume that recursive occurrences are OK
if n `elem` s then return Nothing else do
S.put (n : s)
fmap {-maybe-} (\_ -> bad_app tc) -- don't give the message, just name what wasn't representable
`fmap` {-state-} case canDoGenerics tc tc_args of
j@(Just _) -> return j
-- only check Generic1 if it passes Generic
Nothing -> canDoGenerics1_w tc
fmap {-maybe-} (\_ -> bad_app tc) -- don't give the message, just
-- name what wasn't representable
`fmap` {-state-} canDoGenerics1_w tc
existential = (ptext . sLit) "must not have existential arguments"
covariant = (ptext . sLit) "must not use the last type parameter in a function argument"
......
......@@ -1999,6 +1999,9 @@ import "network" Network.Socket
available from multiple packages, or is present in both the
current package being built and an external package.</para>
<para>The special package name <literal>this</literal> can be used to
refer to the current package being built.</para>
<para>Note: you probably don't need to use this feature, it was
added mainly so that we can build backwards-compatible versions of
packages when APIs change. It can lead to fragile dependencies in
......
......@@ -1868,12 +1868,27 @@ f "2" = 2
<indexterm><primary>constructor fields, strict</primary></indexterm>
</term>
<listitem>
<para>This option causes all constructor fields which are marked
strict (i.e. &ldquo;!&rdquo;) and which representation is smaller or
equal to the size of a pointer to be unpacked if possible. It is
equivalent to adding an <literal>UNPACK</literal> pragma (see <xref
linkend="unpack-pragma"/>) to every strict constructor field that
fullfills the size restriction.
<para>This option causes all constructor fields which are
marked strict (i.e. &ldquo;!&rdquo;) and which
representation is smaller or equal to the size of a
pointer to be unpacked, if possible. It is equivalent to
adding an <literal>UNPACK</literal> pragma (see <xref
linkend="unpack-pragma"/>) to every strict constructor
field that fullfills the size restriction.
</para>
<para>For example, the constructor fields in the following
data types
<programlisting>
data A = A !Int
data B = B !A
newtype C = C B
data D = D !C
</programlisting>
would all be represented by a single
<literal>Int#</literal> (see <xref linkend="primitives"/>)
value with
<option>-funbox-strict-primitive-fields</option> enabled.
</para>
<para>This option is less of a sledgehammer than
......
......@@ -1310,6 +1310,7 @@ typedef struct _RtsSymbolVal {
SymI_NeedsProto(rts_stop_on_exception) \
SymI_HasProto(stopTimer) \
SymI_HasProto(n_capabilities) \
SymI_HasProto(enabled_capabilities) \
SymI_HasProto(stg_traceCcszh) \
SymI_HasProto(stg_traceEventzh) \
SymI_HasProto(stg_traceMarkerzh) \
......
......@@ -1460,10 +1460,28 @@ StgBool stmCommitNestedTransaction(Capability *cap, StgTRecHeader *trec) {
StgTVar *s;
s = e -> tvar;
if (entry_is_update(e)) {
// Careful! We might have a read entry here that we don't want
// to spam over the update entry in the enclosing TRec. e.g. in
//
// t <- newTVar 1
// writeTVar t 2
// ((readTVar t >> retry) `orElse` return ()) `orElse` return ()
//
// - the innermost txn first aborts, giving us a read-only entry
// with e->expected_value == e->new_value == 1
// - the inner orElse commits into the outer orElse, which
// lands us here. If we unconditionally did
// merge_update_into(), then we would overwrite the outer
// TRec's update, so we must check whether the entry is an
// update or not, and if not, just do merge_read_into.
//
if (entry_is_update(e)) {
unlock_tvar(cap, trec, s, e -> expected_value, FALSE);
}
merge_update_into(cap, et, s, e -> expected_value, e -> new_value);
merge_update_into(cap, et, s, e -> expected_value, e -> new_value);
} else {
merge_read_into(cap, et, s, e -> expected_value);
}
ACQ_ASSERT(s -> current_value != (StgClosure *)trec);
});
} else {
......
......@@ -5,6 +5,8 @@ use Cwd;
$| = 1; # autoflush stdout after each print, to avoid output after die
my $initial_working_directory;
my $defaultrepo;
my @packages;
my $verbose = 2;
......@@ -143,13 +145,11 @@ sub gitNewWorkdir {
my $dir = shift;
my $target = shift;
my $target_dir = "$target/$dir";
my $pwd;
if ($dir eq '.') {
message "== running git-new-workdir . $target_dir @_";
} else {
message "== $dir: running git-new-workdir . $target_dir @_";
$pwd = getcwd();
chdir($dir);
}
......@@ -158,20 +158,18 @@ sub gitNewWorkdir {
or die "git-new-workdir failed: $?";
if ($dir ne '.') {
chdir($pwd);
chdir($initial_working_directory);
}
}
sub scm {
my $dir = shift;
my $scm = shift;
my $pwd;
if ($dir eq '.') {
message "== running $scm @_";
} else {
message "== $dir: running $scm @_";
$pwd = getcwd();
chdir($dir);
}
......@@ -180,7 +178,7 @@ sub scm {
or die "$scm failed: $?";
if ($dir ne '.') {
chdir($pwd);
chdir($initial_working_directory);
}
}
......@@ -196,9 +194,7 @@ sub scmall {
my $subcommand;
my $path;
my $wd_before = getcwd;
my $pwd;
my @args;
my $started;
......@@ -796,9 +792,14 @@ sub main {
}
}
BEGIN {
$initial_working_directory = getcwd();
}
END {
my $ec = $?;
my $pwd = getcwd();
chdir($initial_working_directory);
message "== Checking for old haddock repo";
if (-d "utils/haddock/.git") {
......@@ -815,7 +816,7 @@ Please remove it (e.g. "rm -r utils/haddock"), and then run
============================
EOF
}
chdir($pwd);
chdir($initial_working_directory);
}
message "== Checking for old binary repo";
......@@ -833,7 +834,7 @@ Please remove it (e.g. "rm -r libraries/binary"), and then run
============================
EOF
}
chdir($pwd);
chdir($initial_working_directory);
}
message "== Checking for old mtl repo";
......@@ -851,7 +852,7 @@ Please remove it (e.g. "rm -r libraries/mtl"), and then run
============================
EOF
}
chdir($pwd);
chdir($initial_working_directory);
}
message "== Checking for old Cabal repo";
......@@ -869,7 +870,7 @@ Please remove it (e.g. "rm -r libraries/Cabal"), and then run
============================
EOF
}
chdir($pwd);
chdir($initial_working_directory);
}
message "== Checking for old time from tarball";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment