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

Use NO_EXTENSIONTYPING for better compiler debugging in normal case #3912

Merged
merged 2 commits into from
Nov 8, 2017
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
<TargetType>LIBRARY</TargetType>
<NoWarn>58;75</NoWarn>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<DefineConstants>EXTENSIONTYPING;$(DefineConstants)</DefineConstants>
<ResolveNuGetPackages>false</ResolveNuGetPackages>
<OutputPath>..\..\$(Configuration)\fcs\net45\</OutputPath>
<Tailcalls>true</Tailcalls>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<DefineConstants>$(DefineConstants);COMPILER_SERVICE</DefineConstants>
<DefineConstants>$(DefineConstants);COMPILER_SERVICE_ASSUMES_FSHARP_CORE_4_4_0_0</DefineConstants>
<DefineConstants>$(DefineConstants);EXTENSIBLE_DUMPER</DefineConstants>
<DefineConstants>$(DefineConstants);NO_EXTENSIONTYPING</DefineConstants>
<DefineConstants>$(DefineConstants);FSHARP_CORE_4_5</DefineConstants>
<DefineConstants>$(DefineConstants);FX_PORTABLE_OR_NETSTANDARD</DefineConstants>
<DefineConstants>$(DefineConstants);FX_ATLEAST_PORTABLE</DefineConstants>
Expand Down
1 change: 0 additions & 1 deletion fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
<!-- We target .NET 4.5 for FSharp.Compiler.Service.dll to allow broader use of this DLL -->
<TargetFrameworkVersion Condition=" '$(TargetFrameworkVersion)' == '' ">v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile />
<DefineConstants>$(DefineConstants);EXTENSIONTYPING</DefineConstants>
<DefineConstants>$(DefineConstants);CROSS_PLATFORM_COMPILER</DefineConstants>
<DefineConstants>$(DefineConstants);ENABLE_MONO_SUPPORT</DefineConstants>
<DefineConstants>$(DefineConstants);COMPILER</DefineConstants>
Expand Down
1 change: 0 additions & 1 deletion fcs/samples/FscExe/FscExe.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<NoWarn>$(NoWarn);62;44</NoWarn>
<AssemblyName>FscExe</AssemblyName>
<Name>FscExe</Name>
<DefineConstants>EXTENSIONTYPING;$(DefineConstants)</DefineConstants>
<DefineConstants>COMPILER;$(DefineConstants)</DefineConstants>
<DefineConstants>FX_RESIDENT_COMPILER;$(DefineConstants)</DefineConstants>
<AllowCrossTargeting>true</AllowCrossTargeting>
Expand Down
2 changes: 1 addition & 1 deletion src/absil/il.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ type ILTypeRef =

member QualifiedName: string

#if EXTENSIONTYPING
#if !NO_EXTENSIONTYPING
member QualifiedNameWithNoShortPrimaryAssembly: string
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<NoWarn>$(NoWarn);45;55;62;75;1182;1204</NoWarn>
<AllowCrossTargeting>true</AllowCrossTargeting>
<FX_NO_LOADER>true</FX_NO_LOADER>
<DefineConstants>EXTENSIONTYPING;$(DefineConstants)</DefineConstants>
<OtherFlags>$(OtherFlags) --maxerrors:20 --extraoptimizationloops:1</OtherFlags>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<AssemblyName>FSharp.Compiler.Private</AssemblyName>
<NoWarn>$(NoWarn);45;55;62;75;1204</NoWarn>
<AllowCrossTargeting>true</AllowCrossTargeting>
<DefineConstants>$(DefineConstants);EXTENSIONTYPING;COMPILER</DefineConstants>
<DefineConstants>$(DefineConstants);COMPILER</DefineConstants>
<OtherFlags>$(OtherFlags) --warnon:1182 --maxerrors:20 --extraoptimizationloops:1</OtherFlags>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/buildfromsource/Fsc/Fsc.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AssemblyName>fsc</AssemblyName>
<NoWarn>$(NoWarn);45;55;62;75;1204</NoWarn>
<AllowCrossTargeting>true</AllowCrossTargeting>
<DefineConstants>$(DefineConstants);EXTENSIONTYPING;COMPILER</DefineConstants>
<DefineConstants>$(DefineConstants);COMPILER</DefineConstants>
<OtherFlags>$(OtherFlags) --maxerrors:20 --extraoptimizationloops:1</OtherFlags>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/buildfromsource/Fsi/Fsi.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AssemblyName>fsi</AssemblyName>
<NoWarn>$(NoWarn);45;55;62;75;1204</NoWarn>
<AllowCrossTargeting>true</AllowCrossTargeting>
<DefineConstants>$(DefineConstants);BUILD_FROM_SOURCE;COMPILER;EXTENSIONTYPING</DefineConstants>
<DefineConstants>$(DefineConstants);BUILD_FROM_SOURCE;COMPILER</DefineConstants>
<OtherFlags>$(OtherFlags) --warnon:1182 --maxerrors:20 --extraoptimizationloops:1</OtherFlags>
</PropertyGroup>

Expand Down
8 changes: 4 additions & 4 deletions src/fsharp/AccessibilityLogic.fs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ open Microsoft.FSharp.Compiler.Tast
open Microsoft.FSharp.Compiler.Tastops
open Microsoft.FSharp.Compiler.TcGlobals

#if EXTENSIONTYPING
#if !NO_EXTENSIONTYPING
open Microsoft.FSharp.Compiler.ExtensionTyping
#endif

Expand Down Expand Up @@ -228,7 +228,7 @@ let ComputeILAccess isPublic isFamily isFamilyOrAssembly isFamilyAndAssembly =
let IsILFieldInfoAccessible g amap m ad x =
match x with
| ILFieldInfo (tinfo,fd) -> IsILTypeAndMemberAccessible g amap m ad ad tinfo fd.Access
#if EXTENSIONTYPING
#if !NO_EXTENSIONTYPING
| ProvidedField (amap, tpfi, m) as pfi ->
let access = tpfi.PUntaint((fun fi -> ComputeILAccess fi.IsPublic fi.IsFamily fi.IsFamilyOrAssembly fi.IsFamilyAndAssembly), m)
IsProvidedMemberAccessible amap m ad pfi.EnclosingType access
Expand Down Expand Up @@ -314,7 +314,7 @@ let IsTypeAndMethInfoAccessible amap m adTyp ad = function
| ILMeth (g,x,_) -> IsILMethInfoAccessible g amap m adTyp ad x
| FSMeth (_,_,vref,_) -> IsValAccessible ad vref
| DefaultStructCtor(g,typ) -> IsTypeAccessible g amap m ad typ
#if EXTENSIONTYPING
#if !NO_EXTENSIONTYPING
| ProvidedMeth(amap,tpmb,_,m) as etmi ->
let access = tpmb.PUntaint((fun mi -> ComputeILAccess mi.IsPublic mi.IsFamily mi.IsFamilyOrAssembly mi.IsFamilyAndAssembly), m)
IsProvidedMemberAccessible amap m ad etmi.EnclosingType access
Expand All @@ -325,7 +325,7 @@ let IsPropInfoAccessible g amap m ad = function
| ILProp (_,x) -> IsILPropInfoAccessible g amap m ad x
| FSProp (_,_,Some vref,_)
| FSProp (_,_,_,Some vref) -> IsValAccessible ad vref
#if EXTENSIONTYPING
#if !NO_EXTENSIONTYPING
| ProvidedProp (amap, tppi, m) as pp->
let access =
let a = tppi.PUntaint((fun ppi ->
Expand Down
34 changes: 17 additions & 17 deletions src/fsharp/AttributeChecking.fs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ open Microsoft.FSharp.Compiler.Tast
open Microsoft.FSharp.Compiler.Tastops
open Microsoft.FSharp.Compiler.TcGlobals

#if EXTENSIONTYPING
#if !NO_EXTENSIONTYPING
open Microsoft.FSharp.Compiler.ExtensionTyping
open Microsoft.FSharp.Core.CompilerServices
#endif
Expand Down Expand Up @@ -130,7 +130,7 @@ let AttribInfosOfFS g attribs =

let GetAttribInfosOfEntity g amap m (tcref:TyconRef) =
match metadataOfTycon tcref.Deref with
#if EXTENSIONTYPING
#if !NO_EXTENSIONTYPING
// TODO: provided attributes
| ProvidedTypeMetadata _info -> []
//let provAttribs = info.ProvidedType.PApply((fun a -> (a :> IProvidedCustomAttributeProvider)),m)
Expand All @@ -149,7 +149,7 @@ let GetAttribInfosOfMethod amap m minfo =
| ILMeth (g,ilminfo,_) -> ilminfo.RawMetadata.CustomAttrs |> AttribInfosOfIL g amap ilminfo.MetadataScope m
| FSMeth (g,_,vref,_) -> vref.Attribs |> AttribInfosOfFS g
| DefaultStructCtor _ -> []
#if EXTENSIONTYPING
#if !NO_EXTENSIONTYPING
// TODO: provided attributes
| ProvidedMeth (_,_mi,_,_m) ->
[]
Expand All @@ -162,7 +162,7 @@ let GetAttribInfosOfProp amap m pinfo =
| FSProp(g,_,Some vref,_)
| FSProp(g,_,_,Some vref) -> vref.Attribs |> AttribInfosOfFS g
| FSProp _ -> failwith "GetAttribInfosOfProp: unreachable"
#if EXTENSIONTYPING
#if !NO_EXTENSIONTYPING
// TODO: provided attributes
| ProvidedProp _ -> []
#endif
Expand All @@ -171,7 +171,7 @@ let GetAttribInfosOfEvent amap m einfo =
match einfo with
| ILEvent(g, x) -> x.RawMetadata.CustomAttrs |> AttribInfosOfIL g amap x.ILTypeInfo.ILScopeRef m
| FSEvent(_, pi, _vref1, _vref2) -> GetAttribInfosOfProp amap m pi
#if EXTENSIONTYPING
#if !NO_EXTENSIONTYPING
// TODO: provided attributes
| ProvidedEvent _ -> []
#endif
Expand All @@ -183,7 +183,7 @@ let GetAttribInfosOfEvent amap m einfo =
let TryBindTyconRefAttribute g m (AttribInfo (atref,_) as args) (tcref:TyconRef) f1 f2 f3 =
ignore m; ignore f3
match metadataOfTycon tcref.Deref with
#if EXTENSIONTYPING
#if !NO_EXTENSIONTYPING
| ProvidedTypeMetadata info ->
let provAttribs = info.ProvidedType.PApply((fun a -> (a :> IProvidedCustomAttributeProvider)),m)
match provAttribs.PUntaint((fun a -> a.GetAttributeConstructorArgs(provAttribs.TypeProvider.PUntaintNoFailure(id), atref.FullName)),m) with
Expand All @@ -207,22 +207,22 @@ let BindMethInfoAttributes m minfo f1 f2 f3 =
| ILMeth (_,x,_) -> f1 x.RawMetadata.CustomAttrs
| FSMeth (_,_,vref,_) -> f2 vref.Attribs
| DefaultStructCtor _ -> f2 []
#if EXTENSIONTYPING
#if !NO_EXTENSIONTYPING
| ProvidedMeth (_,mi,_,_) -> f3 (mi.PApply((fun st -> (st :> IProvidedCustomAttributeProvider)),m))
#endif

/// Analyze three cases for attributes declared on methods: IL-declared attributes, F#-declared attributes and
/// provided attributes.
let TryBindMethInfoAttribute g m (AttribInfo(atref,_) as attribSpec) minfo f1 f2 f3 =
#if EXTENSIONTYPING
#if !NO_EXTENSIONTYPING
#else
// to prevent unused parameter warning
ignore f3
#endif
BindMethInfoAttributes m minfo
(fun ilAttribs -> TryDecodeILAttribute g atref ilAttribs |> Option.bind f1)
(fun fsAttribs -> TryFindFSharpAttribute g attribSpec fsAttribs |> Option.bind f2)
#if EXTENSIONTYPING
#if !NO_EXTENSIONTYPING
(fun provAttribs ->
match provAttribs.PUntaint((fun a -> a.GetAttributeConstructorArgs(provAttribs.TypeProvider.PUntaintNoFailure(id), atref.FullName)),m) with
| Some args -> f3 args
Expand Down Expand Up @@ -316,7 +316,7 @@ let CheckFSharpAttributes g attribs m =
CompleteD
)

#if EXTENSIONTYPING
#if !NO_EXTENSIONTYPING
/// Check a list of provided attributes for 'ObsoleteAttribute', returning errors and warnings as data
let private CheckProvidedAttributes (g: TcGlobals) m (provAttribs: Tainted<IProvidedCustomAttributeProvider>) =
let (AttribInfo(tref,_)) = g.attrib_SystemObsolete
Expand Down Expand Up @@ -368,7 +368,7 @@ let CheckFSharpAttributesForUnseen g attribs _m =
(CheckFSharpAttributesForObsolete g attribs ||
CheckFSharpAttributesForHidden g attribs)

#if EXTENSIONTYPING
#if !NO_EXTENSIONTYPING
/// Indicate if a list of provided attributes contains 'ObsoleteAttribute'. Used to suppress the item in intellisense.
let CheckProvidedAttributesForUnseen (provAttribs: Tainted<IProvidedCustomAttributeProvider>) m =
provAttribs.PUntaint((fun a -> a.GetAttributeConstructorArgs(provAttribs.TypeProvider.PUntaintNoFailure(id), typeof<System.ObsoleteAttribute>.FullName).IsSome),m)
Expand All @@ -381,7 +381,7 @@ let CheckPropInfoAttributes pinfo m =
| FSProp(g,_,Some vref,_)
| FSProp(g,_,_,Some vref) -> CheckFSharpAttributes g vref.Attribs m
| FSProp _ -> failwith "CheckPropInfoAttributes: unreachable"
#if EXTENSIONTYPING
#if !NO_EXTENSIONTYPING
| ProvidedProp (amap,pi,m) ->
CheckProvidedAttributes amap.g m (pi.PApply((fun st -> (st :> IProvidedCustomAttributeProvider)),m))

Expand All @@ -393,7 +393,7 @@ let CheckILFieldAttributes g (finfo:ILFieldInfo) m =
match finfo with
| ILFieldInfo(_,pd) ->
CheckILAttributes g pd.CustomAttrs m |> CommitOperationResult
#if EXTENSIONTYPING
#if !NO_EXTENSIONTYPING
| ProvidedField (amap,fi,m) ->
CheckProvidedAttributes amap.g m (fi.PApply((fun st -> (st :> IProvidedCustomAttributeProvider)),m)) |> CommitOperationResult
#endif
Expand All @@ -411,7 +411,7 @@ let CheckMethInfoAttributes g m tyargsOpt minfo =
else
CompleteD)
Some res)
#if EXTENSIONTYPING
#if !NO_EXTENSIONTYPING
(fun provAttribs -> Some (CheckProvidedAttributes g m provAttribs))
#else
(fun _provAttribs -> None)
Expand All @@ -427,7 +427,7 @@ let MethInfoIsUnseen g m typ minfo =
match BindMethInfoAttributes m minfo
(fun ilAttribs -> Some(CheckILAttributesForUnseen g ilAttribs m))
(fun fsAttribs -> Some(CheckFSharpAttributesForUnseen g fsAttribs m))
#if EXTENSIONTYPING
#if !NO_EXTENSIONTYPING
(fun provAttribs -> Some(CheckProvidedAttributesForUnseen provAttribs m))
#else
(fun _provAttribs -> None)
Expand All @@ -437,7 +437,7 @@ let MethInfoIsUnseen g m typ minfo =
| None -> false

let isUnseenByHidingAttribute =
#if EXTENSIONTYPING
#if !NO_EXTENSIONTYPING
not (isObjTy g typ) &&
isAppTy g typ &&
isObjTy g minfo.EnclosingType &&
Expand Down Expand Up @@ -470,7 +470,7 @@ let PropInfoIsUnseen m pinfo =
| FSProp (g,_,Some vref,_)
| FSProp (g,_,_,Some vref) -> CheckFSharpAttributesForUnseen g vref.Attribs m
| FSProp _ -> failwith "CheckPropInfoAttributes: unreachable"
#if EXTENSIONTYPING
#if !NO_EXTENSIONTYPING
| ProvidedProp (_amap,pi,m) ->
CheckProvidedAttributesForUnseen (pi.PApply((fun st -> (st :> IProvidedCustomAttributeProvider)),m)) m
#endif
Expand Down