1. 07 1月, 2015 4 次提交
  2. 24 12月, 2014 5 次提交
  3. 04 12月, 2014 3 次提交
  4. 22 11月, 2014 1 次提交
    • A
      Fix Watson crashes in 1024401. · 0da2331a
      angocke 提交于
      At least some of the cab files indicate that the compiler is crashing while emitting custom attributes. This appears to be due to the compiler-generated DebuggerDisplayAttribute which is emitted on anonymous types. The current synthesis of the attribute proceeds without checking if a properly formed DebuggerDisplayAttribute type is present in the compilation.
      
      This changes the attribute synthesis helpers to check if the well-known members exist before synthesizing the attribute. (changeset 1376039)
      0da2331a
  5. 13 11月, 2014 1 次提交
  6. 12 11月, 2014 1 次提交
    • A
      DevDiv #1055825: Associate field-like events with their backing fields on import · 7cb45a75
      acasey 提交于
      Otherwise, every lookup is ambiguous, since they have the same name (and both are accessible while debugging).
      
      Perf impact 1: PEFieldSymbol and PEEventSymbol each gain an additional reference field.
      Perf impact 2: If a field has the same name as an event on the same type, its type will be evaluated eagerly.
      
      Caveat: We're not making a corresponding change for auto-props because the only value would be API consistency.
      
      CR: AlekseyT; NGafter; ToMat (changeset 1370165)
      7cb45a75
  7. 11 11月, 2014 1 次提交
  8. 08 11月, 2014 2 次提交
    • A
      DevDiv #1066489: Debugging inside types with names containing dot · 2e326153
      acasey 提交于
      The problem is that the mangled name for an static machine type looks like
      "<" + methodName + ">d__" + uniqueId.  However, methodName will have dots in it for explicit interface implementations (e.g. "<I.F>d__0").  Unfortunately, the native compiler emits such names in a very strange way: everything before the last dot goes in the namespace (!!) field of the typedef.  Since state machine types are always nested types and since nested types never have explicit namespaces (since they are in the same namespaces as their containing types), it should be safe to check for a non-empty namespace name on a nested type and prepend the namespace name and a dot to the type name.  After that, debugging support falls out.
      
      CR: AnGocke; ToMat; AlekseyT (changeset 1368701)
      2e326153
    • N
      f87321af
  9. 30 10月, 2014 1 次提交
  10. 29 10月, 2014 1 次提交
    • V
      Making lambda codegen to always emit instance delegates. · 3de67f36
      VSadov 提交于
      This way we can have better performance of invocations while keeping parameter list of delegate.Method backwards compatible.
      
      The approach is basically always to emit backing methods into a display class, just that in a case of lambdas not capturing anything, the display classes will not have any fields.
      Also, when display classes do not have any fields, lambdas of all nongeneric methods in a given class can share the same display class and in fact can share the same singleton instance.
      
      ***NO_CI***
       (changeset 1359290)
      3de67f36
  11. 17 10月, 2014 1 次提交
  12. 16 10月, 2014 1 次提交
  13. 07 10月, 2014 2 次提交
    • T
      Merges MetadataReferenceProvider and MetadataReferenceResolver into a single type. · 7fa0b8fc
      TomasMatousek 提交于
      Previously the user had to pass both of these objects to CompilationOptions and the compiler had to call first the resolver to resolve the path specified in #r:
      
      string ResolveReference(string reference, string baseFilePath)
      
      and then the provider to create the reference:
      
      PortableExecutableReference GetReference(string resolvedPath, MetadataReferenceProperties properties)
      
      With this change the compiler simply calls on MetadataReferenceResolver:
      
      ImmutableArray<PortableExecutableReference> ResolveReference(string reference, string baseFilePath, MetadataReferenceProperties properties)
      
      Notice that now the resolver may return multiple references. This is needed to support #r of NuGet packages.
      
      We used reference resolvers and providers in many ways for multiple purposes. I left behind the metadata file resolvers and providers to avoid making too many changes, but made them internal. In some cases the usage is legitimate, but still an implementation detail. More cleanup will also be possible once we remove the old scripting API. For now I have worked around all these dependencies.
       (changeset 1349333)
      7fa0b8fc
    • T
      Introduces EmitOptions for options passed to Compilation.Emit(). · 1621a00f
      TomasMatousek 提交于
           Moves options that were previously on CompilationOptions but were not used until emit phase to EmitOptions: fileAlignment, baseAddress, highEntropyVirtualAddressSpace, subsystemVersion, runtimeMetadataVersion. They hold on values written to various PE headers. We can now easily add other similar PE flags to EmitOptions, which is a common customer request, without affecting code that works with compilation options in other layers (workspaces, project system, etc.).
      
           Removes EmitMeadataOnly method and instead adds a MetadataOnly flag to EmitOptions. Removes MetadataOnlyEmitOptions - they were not used and can now be easily added as bools to EmitOptions.
      
           Moves pdbFilePath and outputName from parameters of Emit to EmitOptions.
      
      IDE: remove tracking of options that were moved to EmitOptions, since the IDE doesn't care about options that don't affect compilation. (changeset 1348623)
      1621a00f
  14. 06 10月, 2014 2 次提交
  15. 04 10月, 2014 1 次提交
  16. 02 10月, 2014 8 次提交
    • N
      Fix 1029117 by adding a null check. (changeset 1346395) · 927099af
      nmgafter 提交于
      927099af
    • V
      Implements a spec refinement to how autoprops behave in constructors. · 1a7ebab9
      VSadov 提交于
      For accesses to an autoprop in a corresponding [static|instance] constructor -
      
      (a) It should bind to the property, but the property should be treated as a readable/writable even if it is a readonly autoprop.
      (b) The definite assignment behavior should be as if directly accessing the backing field.
      (c) It should code gen to the property accessor (if one exists) or a field access (if not).
      
      The most observable outcome of all this is that it is possible to assign a readonly autoprop in the constructor and that
      in a struct instance constructor you no longer need to initialize whole struct before using any of its autoprops.
      
      The following code is now valid and does what you think it does:
      
      public struct S
      {
          public int X{get;}
          public int Y{get;}
      
          public S()
          {
              X = 42;
              Y = X;
          }
      
          public static void Main()
          {
              S s = new S();
              System.Console.WriteLine(s.Y);
          }
      }
      
      .
      
       (changeset 1346315)
      1a7ebab9
    • A
    • T
      This shelveset implements following changes to metadata reference compiler API... · 4fc808ea
      TomasMatousek 提交于
      This shelveset implements following changes to metadata reference compiler API in order to remove duplication in the public surface and prevent users from unexpected metadata lifetime issues:
      
           1) MetadataImageReference and MetadataFileReference overlap
           Currently MetadataImageReference can be constructed from a Stream. MetadataImageReference supports metadata prefetch (reading the blob into memory and close the underlying stream) as well deferred reading (no content is read until the reference is consumed during compilation). MetadataFileReference only supports deferred reading.
      
           Lifetime of MetadataFileReference is non-deterministic, the underlying file is locked until no references exist and we GC the metadata.  On the other hand, it is possible to construct MetadataImageReference in such a way that allows controlling the underlying resources deterministically.
      
           Remove MetadataFileReference, use MetadataImageReference instead.
      
           2) Lifetime management
           AssemblyMetadata and ModuleMetadata objects hold on resources and implement IDisposable. When using MetadataFileReference constructors and some MetadataImageReference constructors to create references the underlying metadata objects are created implicitly and the user doesn’t have a way to explicitly dispose them.
      
           Make MetadataImageReference constructors internal and instead add factory method GetReference on AssemblyMetadata/ModuleMetadata. The usage pattern is:
      
           using (var metadata = AssemblyMetadata.CreateFromXxx(…))
           {
               var compilation = CSharpCompilation.Create(syntaxTrees, new[] { metadata.GetReference() });
               …
           }
      
           In addition the shelveset makes MetadataImageReference internal and adds the following convenience APIs, that are not the most efficient but are very convenient, easy to discover and safe to use for customers that don’t wanna explicitly manage the lifetime of metadata objects. (changeset 1345987)
      4fc808ea
    • V
      Fix bug 1032724: Do not give error CS0842: 'C.X': Automatically implemented... · 464487b4
      vladres 提交于
      Fix bug 1032724: Do not give error CS0842: 'C.X': Automatically implemented properties cannot be used inside a type marked with StructLayout(LayoutKind.Explicit) for static auto-properties (changeset 1345941)
      464487b4
    • A
      C# SymbolDisplay: Do not qualify properties and events with implemented... · c234e558
      AlekseyTs 提交于
      C# SymbolDisplay: Do not qualify properties and events with implemented interface name unless they were already qualified. (changeset 1345691)
      c234e558
    • N
      Rename TypeKind.ArrayType to TypeKind.Array. Temporarily retain the old one [Obsolete]. · 615e229b
      nmgafter 提交于
      Similarly for DynamicType and PointerType. (changeset 1345275)
      615e229b
    • A
      edb06547
  17. 27 9月, 2014 1 次提交
  18. 26 9月, 2014 2 次提交
    • T
      AssemblyMetadata and ModuleMetadata factories should not read the content of... · 06979fd8
      TomasMatousek 提交于
       AssemblyMetadata and ModuleMetadata factories should not read the content of the PE file/metadata blob.
      
           Currently the factories read the headers, Assembly and Modules tables, which might result in BadImageFormatException being thrown. This exception is not turned into a compilation diagnostic because it happens before the compilation is created. A user of the Roslyn API thus needs to handle these errors in two places (as an exception and as a diagnostics). The content reading should be deferred until the AssemblyMetadata/ModuleMetadata is queried for content.
      
           This change defers metadata/PE headers reading and decoding until the AssemblyMetadata and ModuleMetadata properties/methods are called.
           For metadata created from files it aims to match the usage pattern of other APIs working with FileStream. The metadata factory opens the file, which might throw IO exception, but doesn't start reading the stream until the compiler asks for it, therefore it doesn't throw BadImageFormatException. The functionality is equivalent to the user opening a FileStream and creating metadata from that stream (except for a slight complication with multi-module assemblies, which are rare). Thus the API for metadata creation are consistent among in-memory byte array, stream, and file path.  (changeset 1342462)
      06979fd8
    • V
      Making instance field and property initializers in structs an error. Making... · 4e2b2938
      VSadov 提交于
      Making instance field and property initializers in structs an error. Making the instance constructors in structs not experimental. (changeset 1342196)
      4e2b2938
  19. 25 9月, 2014 2 次提交
    • V
      Fixes subtle potential race condition that could be allowed by the lowering... · 06c83837
      VSadov 提交于
       Fixes subtle potential race condition that could be allowed by the lowering of null-propagating operator.
      The general rule here is that compiler should not introduce reads to the same location on the heap. Doing so can introduce races to the user's code that otherwise does not have races.
      
      As a result of that it is ok to read a local variable multiple times, but only if the local cannot be modified in between reads and when it is known to not be captured into a closure.
      In particular at lowering stage (before lambda rewritings) without additional analysis we do not know if locals could be captured into closures and therefore shared with other threads and modified between reads.
      
                == in this change:
      Do not assume that reads of locals and byval parameters are idempotent if we do not know whether they may be captured in closures.
      Without additional analysis we can not make this assumption, so at the time of local rewrite we must conservatively consider locals and parameters as potentially returning different value every time they are evaluated.
      
      Note that nullables are excluded from this rule. That is because in the ?. operators over nullable we do not read the same location twice. We read "HasValue" and then conditionaly read ValueOrDefault.
       That is no different than just reading both values unconditionally - we would not introduce any new races if we do not cache the whole local between such reads.
       .
       (changeset 1341599)
      06c83837
    • A
      Scripting API changes · 4d958377
      acasey 提交于
      Checking in for MattWar. (changeset 1340558)
      4d958377