// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Concurrent; #if CODE_STYLE using Microsoft.CodeAnalysis.Internal.Options; #else using Microsoft.CodeAnalysis.Options; #endif namespace Microsoft.CodeAnalysis.Internal.Log { internal static class FunctionIdOptions { private static readonly ConcurrentDictionary> s_options = new ConcurrentDictionary>(); private static readonly Func> s_optionCreator = CreateOption; private static Option CreateOption(FunctionId id) { var name = Enum.GetName(typeof(FunctionId), id); return new Option(nameof(FunctionIdOptions), name, defaultValue: false, storageLocations: new LocalUserProfileStorageLocation(@"Roslyn\Internal\Performance\FunctionId\" + name)); } public static Option GetOption(FunctionId id) { return s_options.GetOrAdd(id, s_optionCreator); } } }