Skip to content

Commit 74287eb

Browse files
committed
Merge pull request #398 from dsyme/integrate-13
Integrate visualfsharp/OOB and fsharp/master --> master
2 parents 39dd627 + cb3b9ce commit 74287eb

File tree

90 files changed

+2506
-318
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+2506
-318
lines changed

src/absil/ilread.fs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,7 @@ type ILReaderContext =
945945
userStringsStreamPhysicalLoc: int32;
946946
stringsStreamPhysicalLoc: int32;
947947
blobsStreamPhysicalLoc: int32;
948+
blobsStreamSize: int32;
948949
readUserStringHeap: (int32 -> string);
949950
memoizeString: string -> string;
950951
readStringHeap: (int32 -> string);
@@ -1420,9 +1421,13 @@ let readStringHeapUncached ctxtH idx =
14201421
let readStringHeap ctxt idx = ctxt.readStringHeap idx
14211422
let readStringHeapOption ctxt idx = if idx = 0 then None else Some (readStringHeap ctxt idx)
14221423

1424+
let emptyByteArray: byte[] = [||]
14231425
let readBlobHeapUncached ctxtH idx =
14241426
let ctxt = getHole ctxtH
1425-
seekReadBlob ctxt.is (ctxt.blobsStreamPhysicalLoc + idx)
1427+
// valid index lies in range [1..streamSize)
1428+
// NOTE: idx cannot be 0 - Blob\String heap has first empty element that is one byte 0
1429+
if idx <= 0 || idx >= ctxt.blobsStreamSize then emptyByteArray
1430+
else seekReadBlob ctxt.is (ctxt.blobsStreamPhysicalLoc + idx)
14261431
let readBlobHeap ctxt idx = ctxt.readBlobHeap idx
14271432
let readBlobHeapOption ctxt idx = if idx = 0 then None else Some (readBlobHeap ctxt idx)
14281433

@@ -3862,6 +3867,7 @@ let rec genOpenBinaryReader infile is opts =
38623867
userStringsStreamPhysicalLoc = userStringsStreamPhysicalLoc;
38633868
stringsStreamPhysicalLoc = stringsStreamPhysicalLoc;
38643869
blobsStreamPhysicalLoc = blobsStreamPhysicalLoc;
3870+
blobsStreamSize = blobsStreamSize;
38653871
memoizeString = Tables.memoize id;
38663872
readUserStringHeap = cacheUserStringHeap (readUserStringHeapUncached ctxtH);
38673873
readStringHeap = cacheStringHeap (readStringHeapUncached ctxtH);

src/fsharp/FSComp.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -928,9 +928,9 @@ optsEmitDebugInfoInQuotations,"Emit debug information in quotations"
928928
# service.fs strings
929929
# -----------------------------------------------------------------------------
930930
typeInfoFullName,"Full name"
931-
typeInfoType,"type"
932-
typeInfoInherits,"inherits"
933-
typeInfoImplements,"implements"
931+
# typeInfoType,"type"
932+
# typeInfoInherits,"inherits"
933+
# typeInfoImplements,"implements"
934934
typeInfoOtherOverloads,"and %d other overloads"
935935
typeInfoUnionCase,"union case"
936936
typeInfoActivePatternResult,"active pattern result"
@@ -1089,8 +1089,8 @@ lexHashBangMustBeFirstInFile,"#! may only appear as the first line at the start
10891089
1189,parsNonAdjacentTypars,"Type parameters must be placed directly adjacent to the type name, e.g. \"type C<'T>\", not type \"C <'T>\""
10901090
1190,parsNonAdjacentTyargs,"Type arguments must be placed directly adjacent to the type name, e.g. \"C<'T>\", not \"C <'T>\""
10911091
parsNonAtomicType,"The use of the type syntax 'int C' and 'C <int>' is not permitted here. Consider adjusting this type to be written in the form 'C<int>'"
1092-
1191,tastUndefinedTyconItemField,"The type %s did not contain the field '%s'"
1093-
1192,tastUndefinedTyconItemUnionCase,"The type %s did not contain the union case '%s'"
1092+
# 1191,tastUndefinedTyconItemField,"The type %s did not contain the field '%s'"
1093+
# 1192,tastUndefinedTyconItemUnionCase,"The type %s did not contain the union case '%s'"
10941094
1193,tastUndefinedItemRefModuleNamespace,"The module/namespace '%s' from compilation unit '%s' did not contain the module/namespace '%s'"
10951095
1194,tastUndefinedItemRefVal,"The module/namespace '%s' from compilation unit '%s' did not contain the val '%s'"
10961096
1195,tastUndefinedItemRefModuleNamespaceType,"The module/namespace '%s' from compilation unit '%s' did not contain the namespace, module or type '%s'"
@@ -1342,3 +1342,5 @@ estApplyStaticArgumentsForMethodNotImplemented,"A type provider implemented GetS
13421342
3184,ppparsIncompleteExpression,"Incomplete preprocessor expression"
13431343
3185,ppparsMissingToken,"Missing token '%s' in preprocessor expression"
13441344
3186,pickleMissingDefinition,"An error occurred while reading the F# metadata node at position %d in table '%s' of assembly '%s'. The node had no matching declaration. Please report this warning. You may need to recompile the F# assembly you are using."
1345+
3187,checkNotSufficientlyGenericBecauseOfScope,"Type inference caused the type variable %s to escape its scope. Consider adding an explicit type parameter declaration or adjusting your code to be less generic."
1346+
3188,checkNotSufficientlyGenericBecauseOfScopeAnon,"Type inference caused an inference type variable to escape its scope. Consider adding type annotations to make your code less generic."

src/fsharp/Optimizer.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,9 +1716,6 @@ let TryDetectQueryQuoteAndRun cenv (expr:Expr) =
17161716

17171717
let rec OptimizeExpr cenv (env:IncrementalOptimizationEnv) expr =
17181718

1719-
// foreach --> fast integer for loops
1720-
let expr = DetectFastIntegerForLoops cenv.g expr
1721-
17221719
// Eliminate subsumption coercions for functions. This must be done post-typechecking because we need
17231720
// complete inference types.
17241721
let expr = NormalizeAndAdjustPossibleSubsumptionExprs cenv.g expr
@@ -2087,6 +2084,9 @@ and OptimizeLetRec cenv env (binds,bodyExpr,m) =
20872084
//-------------------------------------------------------------------------
20882085

20892086
and OptimizeLinearExpr cenv env expr contf =
2087+
2088+
let expr = DetectAndOptimizeForExpression cenv.g OptimizeAllForExpressions expr
2089+
20902090
if verboseOptimizations then dprintf "OptimizeLinearExpr\n";
20912091
let expr = if cenv.settings.ExpandStructrualValues() then ExpandStructuralBinding cenv expr else expr
20922092
match expr with

0 commit comments

Comments
 (0)