Implement -fwarn-dodgy-imports
[ghc-hetmet.git] / driver / mangler / ghc-asm.lprl
index 88766cb..9a73bd2 100644 (file)
@@ -59,6 +59,20 @@ for the same reason.  Advantage: No more ridiculous call sequences.
 %************************************************************************
 
 \begin{code}
+############################################################################
+# Make all regexp matching multi-line aware.  This replaces the line below
+# originally found in "sub mangle_asm":
+#
+#  local($*) = 1;
+#
+# This used to work, but Perl 5.10 removes support for $*, so we uses an
+# equivalent construct that works in Perl 5.6 and later.
+#
+BEGIN { if ($] >= 5.010) {
+    require overload; overload::constant( qr => sub { "(?m:$_[1])" } );
+} }
+############################################################################
+
 $TargetPlatform = $TARGETPLATFORM;
 
 ($Pgm = $0) =~ s|.*/||;
@@ -542,10 +556,8 @@ print STDERR "T_HDR_vector: $T_HDR_vector\n";
 \begin{code}
 sub mangle_asm {
     local($in_asmf, $out_asmf) = @_;
-
-    # multi-line regexp matching:
-    local($*) = 1;
     local($i, $c);
+    local($*) = 1;
 
     # ia64-specific information for code chunks
     my $ia64_locnum;