Fix Mono C++ build. (#37153)
authorJohan Lorensson <lateralusx.github@gmail.com>
Sat, 30 May 2020 00:52:53 +0000 (02:52 +0200)
committerGitHub <noreply@github.com>
Sat, 30 May 2020 00:52:53 +0000 (02:52 +0200)
20 files changed:
src/mono/mono/eventpipe/ep-block-internals.c
src/mono/mono/eventpipe/ep-block.c
src/mono/mono/eventpipe/ep-config.c
src/mono/mono/eventpipe/ep-event-source-internals.c
src/mono/mono/eventpipe/ep-internals.c
src/mono/mono/eventpipe/ep-metadata-generator.c
src/mono/mono/eventpipe/ep-provider-internals.c
src/mono/mono/eventpipe/ep-rt-mono.h
src/mono/mono/eventpipe/ep-rt-types.h
src/mono/mono/eventpipe/ep-session-internals.c
src/mono/mono/eventpipe/ep-session.c
src/mono/mono/eventpipe/ep-stream-internals.c
src/mono/mono/eventpipe/ep-types.h
src/mono/mono/eventpipe/ep.c
src/mono/mono/metadata/appdomain.c
src/mono/mono/metadata/icall-eventpipe.c
src/mono/mono/metadata/native-library.c
src/mono/mono/metadata/object.c
src/mono/mono/mini/monovm.c
src/mono/msvc/libeventpipe.targets

index 3d3f647..8727043 100644 (file)
@@ -434,7 +434,7 @@ ep_sequence_point_block_init (
        EP_ASSERT (sequence_point_block != NULL);
        ep_return_null_if_nok (sequence_point != NULL);
 
-       ep_raise_error_if_nok (ep_event_block_base_init (
+       ep_return_null_if_nok (ep_event_block_base_init (
                &sequence_point_block->event_block_base,
                &sequence_point_block_vtable,
                sequence_point_get_block_size (sequence_point),
@@ -465,12 +465,7 @@ ep_sequence_point_block_init (
                sequence_point_block->event_block_base.block.write_pointer += sizeof (sequence_number);
        }
 
-ep_on_exit:
        return sequence_point_block;
-
-ep_on_error:
-       sequence_point_block = NULL;
-       ep_exit_error_handler ();
 }
 
 void
index 214d381..0573679 100644 (file)
@@ -168,13 +168,12 @@ ep_event_block_base_write_event (
        bool is_sorted_event)
 {
        ep_return_false_if_nok (event_block_base != NULL && event_instance != NULL);
-
-       EventPipeBlock *block = ep_event_block_base_get_block_ref (event_block_base);
-       ep_raise_error_if_nok (ep_block_get_block (block) != NULL);
+       ep_return_false_if_nok (ep_block_get_block (ep_event_block_base_get_block_ref (event_block_base)) != NULL);
 
        uint32_t data_len = 0;
        uint8_t * aligned_end = NULL;
        uint32_t capture_proc_number = ep_event_instance_get_proc_num (event_instance);
+       EventPipeBlock *block = ep_event_block_base_get_block_ref (event_block_base);
        uint8_t * write_pointer = ep_block_get_write_pointer (block);
 
        if (!ep_event_block_base_get_use_header_compression (event_block_base)) {
@@ -333,7 +332,8 @@ ep_event_block_base_write_event (
 
        EP_ASSERT (write_pointer == aligned_end);
 
-       int64_t instance_timestamp = ep_event_instance_get_timestamp (event_instance);
+       int64_t instance_timestamp;
+       instance_timestamp = ep_event_instance_get_timestamp (event_instance);
        if (ep_event_block_base_get_min_timestamp (event_block_base) > instance_timestamp)
                ep_event_block_base_set_min_timestamp (event_block_base, instance_timestamp);
        if (ep_event_block_base_get_max_timestamp (event_block_base) > instance_timestamp)
@@ -358,11 +358,9 @@ ep_stack_block_write_stack (
 {
        ep_return_false_if_nok (stack_block != NULL);
 
-       EventPipeBlock *block = ep_event_block_base_get_block_ref (ep_stack_block_get_event_block_base_ref (stack_block));
-       ep_raise_error_if_nok (block != NULL && ep_block_get_block (block) != NULL);
-
        uint32_t stack_size = ep_stack_contents_get_size (stack);
        uint32_t total_size = sizeof (stack_size) + stack_size;
+       EventPipeBlock *block = ep_event_block_base_get_block_ref (ep_stack_block_get_event_block_base_ref (stack_block));
        uint8_t *write_pointer = ep_block_get_write_pointer (block);
 
        ep_raise_error_if_nok (write_pointer + total_size < ep_block_get_end_of_the_buffer (block));
index 24b6461..1c82915 100644 (file)
@@ -149,7 +149,7 @@ ep_config_init (EventPipeConfiguration *config)
 {
        ep_rt_config_requires_lock_not_held ();
 
-       ep_return_false_if_nok (config != NULL);
+       ep_return_null_if_nok (config != NULL);
 
        ep_config_set_config_provider (config, ep_create_provider (ep_config_get_default_provider_name_utf8 (), NULL, NULL));
        ep_raise_error_if_nok (ep_config_get_config_provider (config) != NULL);
@@ -309,6 +309,7 @@ ep_config_build_event_metadata_event (
        // - GUID ProviderID.
        // - Optional event description payload.
 
+       EventPipeEventMetadataEvent *instance = NULL;
        uint8_t *instance_payload = NULL;
 
        // Calculate the size of the event.
@@ -325,7 +326,8 @@ ep_config_build_event_metadata_event (
        ep_raise_error_if_nok (instance_payload != NULL);
        
        // Fill the buffer with the payload.
-       uint8_t *current = instance_payload;
+       uint8_t *current;
+       current = instance_payload;
 
        memcpy(current, &metadata_id, sizeof(metadata_id));
        current += sizeof(metadata_id);
@@ -337,7 +339,7 @@ ep_config_build_event_metadata_event (
        memcpy(current, payload_data, payload_data_len);
 
        // Construct the metadata event instance.
-       EventPipeEventMetadataEvent *instance = ep_event_metdata_event_alloc (
+       instance = ep_event_metdata_event_alloc (
                ep_config_get_metadata_event (config),
                ep_rt_current_processor_get_number (),
                ep_rt_current_thread_get_id (),
index e283a37..84519ca 100644 (file)
@@ -26,7 +26,8 @@ ep_event_source_alloc (void)
 
        // Generate metadata.
        EventPipeParameterDesc params [1];
-       const uint32_t params_len = EP_ARRAY_SIZE (params);
+       uint32_t params_len;
+       params_len = EP_ARRAY_SIZE (params);
 
        command_line_arg_utf16 = ep_rt_utf8_to_utf16_string ("CommandLine", -1);
        ep_raise_error_if_nok (command_line_arg_utf16 != NULL);
@@ -36,7 +37,8 @@ ep_event_source_alloc (void)
        event_name_utf16 = ep_rt_utf8_to_utf16_string ("ProcessInfo", -1);
        ep_raise_error_if_nok (event_name_utf16 != NULL);
 
-       size_t metadata_len = 0;
+       size_t metadata_len;
+       metadata_len = 0;
        metadata = ep_metadata_generator_generate_event_metadata (
                1,              /* eventID */
                event_name_utf16,
index 58bc70d..0934ec0 100644 (file)
@@ -216,7 +216,7 @@ ep_provider_config_init (
        EventPipeProviderConfiguration *provider_config,
        const ep_char8_t *provider_name,
        uint64_t keywords,
-       uint32_t logging_level,
+       EventPipeEventLevel logging_level,
        const ep_char8_t *filter_data)
 {
        EP_ASSERT (provider_config != NULL);
index 4fd8035..36d7529 100644 (file)
@@ -25,6 +25,9 @@ ep_metadata_generator_generate_event_metadata (
        ep_return_null_if_nok (params_len == 0 || params != NULL);
        ep_return_null_if_nok (metadata_len != NULL);
 
+       uint8_t *buffer = NULL;
+       uint8_t * current = NULL;
+
        // The order of fields is defined in coreclr\src\mscorlib\shared\System\Diagnostics\Tracing\EventSource.cs DefineEventPipeEvents method
        // eventID                      : 4 bytes
        // eventName            : (eventName.Length + 1) * 2 bytes
@@ -42,10 +45,10 @@ ep_metadata_generator_generate_event_metadata (
        }
 
        // Allocate a metadata blob.
-       uint8_t *buffer = ep_rt_byte_array_alloc (*metadata_len);
+       buffer = ep_rt_byte_array_alloc (*metadata_len);
        ep_raise_error_if_nok (buffer != NULL);
 
-       uint8_t * current = buffer;
+       current = buffer;
 
        // Write the event ID.
        memcpy (current, &event_id, sizeof (event_id));
index a93197a..250fc6d 100644 (file)
@@ -33,7 +33,7 @@ ep_provider_alloc (
        EventPipeCallback callback_func,
        void *callback_data)
 {
-       ep_return_false_if_nok (config != NULL && provider_name != NULL);
+       ep_return_null_if_nok (config != NULL && provider_name != NULL);
 
        EventPipeProvider *instance = ep_rt_object_alloc (EventPipeProvider);
        ep_raise_error_if_nok (instance != NULL);
index 8bcb8a1..c7b44da 100644 (file)
@@ -749,7 +749,7 @@ ep_rt_file_open_write (const ep_char8_t *path)
        ep_char16_t *path_utf16 = ep_rt_utf8_to_utf16_string (path, -1);
        ep_return_null_if_nok (path_utf16 != NULL);
 
-       gpointer file_handle = ep_rt_mono_w32file_create (path_utf16, GENERIC_WRITE, FILE_SHARE_READ, CREATE_ALWAYS, FileAttributes_Normal);
+       gpointer file_handle = ep_rt_mono_w32file_create ((gunichar2 *)path_utf16, GENERIC_WRITE, FILE_SHARE_READ, CREATE_ALWAYS, FileAttributes_Normal);
        ep_rt_utf16_string_free (path_utf16);
 
        return file_handle;
index cb0a9af..53c78e6 100644 (file)
@@ -1,6 +1,10 @@
 #ifndef __EVENTPIPE_RT_TYPES_H__
 #define __EVENTPIPE_RT_TYPES_H__
 
+#include <config.h>
+
+#ifdef ENABLE_PERFTRACING
+
 #define EP_ASSERT(expr) ep_rt_redefine
 #define EP_LIKELY(expr) ep_rt_redefine
 #define EP_UNLIKELY(expr) ep_rt_redefine
@@ -19,4 +23,5 @@
 
 #include "ep-rt-types-mono.h"
 
+#endif /* ENABLE_PERFTRACING */
 #endif /* __EVENTPIPE_RT_TYPES_H__ */
index 3ed2a11..8455a99 100644 (file)
@@ -30,6 +30,7 @@ ep_session_alloc (
 
        FileStreamWriter *file_stream_writer = NULL;
        IpcStreamWriter *ipc_stream_writer = NULL;
+       size_t sequence_point_alloc_budget = 0;
 
        EventPipeSession *instance = ep_rt_object_alloc (EventPipeSession);
        ep_raise_error_if_nok (instance != NULL);
@@ -43,8 +44,6 @@ ep_session_alloc (
        instance->format = format;
        instance->rundown_requested = rundown_requested;
 
-       size_t sequence_point_alloc_budget = 0;
-
        // Hard coded 10MB for now, we'll probably want to make
        // this configurable later.
        if (instance->session_type != EP_SESSION_TYPE_LISTENER && instance->format >= EP_SERIALIZATION_FORMAT_NETTRACE_V4) {
index f4e4caa..4761b11 100644 (file)
@@ -89,7 +89,7 @@ ep_session_enable_rundown_lock_held (EventPipeSession *session)
        //!  JittedMethodILToNativeMapKeyword   (0x00020000)
        //!  ThreadTransferKeyword              (0x80000000)
        const uint64_t keywords = 0x80020138;
-       const uint32_t verbose_logging_level = (uint32_t)EP_EVENT_LEVEL_VERBOSE;
+       const EventPipeEventLevel verbose_logging_level = EP_EVENT_LEVEL_VERBOSE;
 
        EventPipeProviderConfiguration rundown_providers [2];
        uint32_t rundown_providers_len = EP_ARRAY_SIZE (rundown_providers);
@@ -201,7 +201,7 @@ ep_session_get_next_event (EventPipeSession *session)
 EventPipeWaitHandle
 ep_session_get_wait_event (EventPipeSession *session)
 {
-       ep_raise_error_if_nok (session != NULL);
+       ep_return_zero_if_nok (session != NULL);
 
        EventPipeBufferManager *buffer_manager = ep_session_get_buffer_manager (session);
        ep_raise_error_if_nok (buffer_manager != NULL);
index c62c857..3de812f 100644 (file)
@@ -109,6 +109,9 @@ ep_fast_serializer_alloc (StreamWriter *stream_writer)
 {
        ep_return_null_if_nok (stream_writer != NULL);
 
+       const ep_char8_t signature[] = "!FastSerialization.1"; // the consumer lib expects exactly the same string, it must not be changed
+       uint32_t signature_len = EP_ARRAY_SIZE (signature) - 1;
+
        FastSerializer *instance = ep_rt_object_alloc (FastSerializer);
        ep_raise_error_if_nok (instance != NULL);
 
@@ -117,8 +120,6 @@ ep_fast_serializer_alloc (StreamWriter *stream_writer)
        instance->required_padding = 0;
        instance->write_error_encountered = false;
 
-       const ep_char8_t signature[] = "!FastSerialization.1"; // the consumer lib expects exactly the same string, it must not be changed
-       uint32_t signature_len = EP_ARRAY_SIZE (signature) - 1;
        ep_fast_serializer_write_string (instance, signature, signature_len);
 
 ep_on_exit:
index 7e25f32..c372a5e 100644 (file)
@@ -378,7 +378,7 @@ ep_provider_config_init (
        EventPipeProviderConfiguration *provider_config,
        const ep_char8_t *provider_name,
        uint64_t keywords,
-       uint32_t logging_level,
+       EventPipeEventLevel logging_level,
        const ep_char8_t *filter_data);
 
 void
index 3725a82..56759f1 100644 (file)
@@ -144,10 +144,11 @@ enable_lock_held (
 
        EventPipeSession *session = NULL;
        EventPipeSessionID session_id = 0;
+       uint32_t session_index = 0;
 
        ep_raise_error_if_nok (ep_volatile_load_eventpipe_state () == EP_STATE_INITIALIZED);
 
-       const uint32_t session_index = generate_session_index_lock_held ();
+       session_index = generate_session_index_lock_held ();
        ep_raise_error_if_nok (session_index < EP_MAX_NUMBER_OF_SESSIONS);
 
        session = ep_session_alloc (
@@ -649,8 +650,7 @@ ep_start_streaming (EventPipeSessionID session_id)
 
        EP_CONFIG_LOCK_ENTER
                ep_raise_error_if_nok_holding_lock (is_session_id_in_collection_lock_held (session_id) == true);
-               EventPipeSession *const session = (EventPipeSession *)session_id;
-               ep_session_start_streaming_lock_held (session);
+               ep_session_start_streaming_lock_held ((EventPipeSession *)session_id);
        EP_CONFIG_LOCK_EXIT
 
 ep_on_exit:
index abc644c..fd18732 100644 (file)
@@ -1609,7 +1609,8 @@ mono_domain_fire_assembly_load_event (MonoDomain *domain, MonoAssembly *assembly
        MONO_STATIC_POINTER_INIT_END (MonoMethod, method)
        goto_if_nok (error, exit);
 
-       MonoReflectionAssemblyHandle assembly_handle = mono_assembly_get_object_handle (domain, assembly, error);
+       MonoReflectionAssemblyHandle assembly_handle;
+       assembly_handle = mono_assembly_get_object_handle (domain, assembly, error);
        goto_if_nok (error, exit);
 
        gpointer args [1];
@@ -2603,8 +2604,10 @@ ves_icall_System_Reflection_Assembly_InternalLoad (MonoStringHandle name_handle,
        if (!parsed)
                goto fail;
 
-       MonoAssemblyCandidatePredicate predicate = NULL;
-       void* predicate_ud = NULL;
+       MonoAssemblyCandidatePredicate predicate;
+       void* predicate_ud;
+       predicate = NULL;
+       predicate_ud = NULL;
        if (mono_loader_get_strict_assembly_name_check ()) {
                predicate = &mono_assembly_candidate_predicate_sn_same_name;
                predicate_ud = &aname;
index 9f64e90..4d26a82 100644 (file)
@@ -76,7 +76,7 @@ static
 EventPipeThread *
 eventpipe_thread_get (void)
 {
-       EventPipeThreadHolder *thread_holder = mono_native_tls_get_value (ep_rt_mono_thread_holder_tls_id);
+       EventPipeThreadHolder *thread_holder = (EventPipeThreadHolder *)mono_native_tls_get_value (ep_rt_mono_thread_holder_tls_id);
        return thread_holder ? ep_thread_holder_get_thread (thread_holder) : NULL;
 }
 
@@ -175,7 +175,7 @@ ves_icall_System_Diagnostics_Tracing_EventPipeInternal_CreateProvider (
        char *provider_name_utf8 = mono_string_handle_to_utf8 (provider_name, error);
 
        //TODO: Need to pin delegate if we switch to safe mode or maybe we should get funcptr in icall?
-       provider = ep_create_provider (provider_name_utf8, MONO_HANDLE_GETVAL (callback_func, delegate_trampoline), NULL);
+       provider = ep_create_provider (provider_name_utf8, (EventPipeCallback)MONO_HANDLE_GETVAL (callback_func, delegate_trampoline), NULL);
 
        g_free (provider_name_utf8);
        return provider;
@@ -230,10 +230,24 @@ ves_icall_System_Diagnostics_Tracing_EventPipeInternal_Enable (
 
        char *output_file_utf8 = mono_utf16_to_utf8 (output_file, g_utf16_len (output_file), error);
 
+       EventPipeProviderConfigurationNative *native_config_providers = (EventPipeProviderConfigurationNative *)providers;
+       EventPipeProviderConfiguration *config_providers = g_new0 (EventPipeProviderConfiguration, providers_len);
+
+       if (config_providers) {
+               for (int i = 0; i < providers_len; ++i) {
+                       ep_provider_config_init (
+                               &config_providers[i],
+                               native_config_providers[i].provider_name ? mono_utf16_to_utf8 (native_config_providers[i].provider_name, g_utf16_len (native_config_providers[i].provider_name), error) : NULL,
+                               native_config_providers [i].keywords,
+                               (EventPipeEventLevel)native_config_providers [i].logging_level,
+                               native_config_providers[i].filter_data ? mono_utf16_to_utf8 (native_config_providers[i].filter_data, g_utf16_len (native_config_providers[i].filter_data), error) : NULL);
+               }
+       }
+
        session_id = ep_enable (
                output_file_utf8,
                circular_buffer_size_mb,
-               providers,
+               config_providers,
                providers_len,
                output_file != NULL ? EP_SESSION_TYPE_FILE : EP_SESSION_TYPE_LISTENER,
                (EventPipeSerializationFormat)format,
@@ -242,6 +256,14 @@ ves_icall_System_Diagnostics_Tracing_EventPipeInternal_Enable (
                true);
        ep_start_streaming (session_id);
 
+       if (config_providers) {
+               for (int i = 0; i < providers_len; ++i) {
+                       ep_provider_config_fini (&config_providers[i]);
+                       g_free ((ep_char8_t *)config_providers[i].provider_name);
+                       g_free ((ep_char8_t *)config_providers[i].filter_data);
+               }
+       }
+
        g_free (output_file_utf8);
        return session_id;
 }
index 6b441a9..60db13d 100644 (file)
@@ -565,12 +565,16 @@ netcore_resolve_with_dll_import_resolver (MonoAssemblyLoadContext *alc, MonoAsse
 
        HANDLE_FUNCTION_ENTER ();
 
-       MonoStringHandle scope_handle = mono_string_new_handle (domain, scope, error);
+       MonoStringHandle scope_handle;
+       scope_handle = mono_string_new_handle (domain, scope, error);
        goto_if_nok (error, leave);
-       MonoReflectionAssemblyHandle assembly_handle = mono_assembly_get_object_handle (domain, assembly, error);
+
+       MonoReflectionAssemblyHandle assembly_handle;
+       assembly_handle = mono_assembly_get_object_handle (domain, assembly, error);
        goto_if_nok (error, leave);
 
-       gboolean has_search_flags = flags != 0 ? TRUE : FALSE;
+       gboolean has_search_flags;
+       has_search_flags = flags != 0 ? TRUE : FALSE;
        gpointer args [5];
        args [0] = MONO_HANDLE_RAW (scope_handle);
        args [1] = MONO_HANDLE_RAW (assembly_handle);
@@ -625,10 +629,12 @@ netcore_resolve_with_load (MonoAssemblyLoadContext *alc, const char *scope, Mono
 
        HANDLE_FUNCTION_ENTER ();
 
-       MonoStringHandle scope_handle = mono_string_new_handle (mono_alc_domain (alc), scope, error);
+       MonoStringHandle scope_handle;
+       scope_handle = mono_string_new_handle (mono_alc_domain (alc), scope, error);
        goto_if_nok (error, leave);
 
-       gpointer gchandle = GUINT_TO_POINTER (alc->gchandle);
+       gpointer gchandle;
+       gchandle = GUINT_TO_POINTER (alc->gchandle);
        gpointer args [3];
        args [0] = MONO_HANDLE_RAW (scope_handle);
        args [1] = &gchandle;
@@ -682,12 +688,16 @@ netcore_resolve_with_resolving_event (MonoAssemblyLoadContext *alc, MonoAssembly
 
        HANDLE_FUNCTION_ENTER ();
 
-       MonoStringHandle scope_handle = mono_string_new_handle (domain, scope, error);
+       MonoStringHandle scope_handle;
+       scope_handle = mono_string_new_handle (domain, scope, error);
        goto_if_nok (error, leave);
-       MonoReflectionAssemblyHandle assembly_handle = mono_assembly_get_object_handle (domain, assembly, error);
+
+       MonoReflectionAssemblyHandle assembly_handle;
+       assembly_handle = mono_assembly_get_object_handle (domain, assembly, error);
        goto_if_nok (error, leave);
 
-       gpointer gchandle = GUINT_TO_POINTER (alc->gchandle);
+       gpointer gchandle;
+       gchandle = GUINT_TO_POINTER (alc->gchandle);
        gpointer args [4];
        args [0] = MONO_HANDLE_RAW (scope_handle);
        args [1] = MONO_HANDLE_RAW (assembly_handle);
index c9bacf3..f0beb59 100644 (file)
@@ -6550,7 +6550,8 @@ ves_icall_System_GC_AllocPinnedArray (MonoReflectionTypeHandle array_type, gint3
        MonoVTable *vtable = mono_class_vtable_checked (mono_domain_get (), klass, error);
        goto_if_nok (error, fail);
 
-       MonoArray *arr = mono_array_new_specific_internal (vtable, length, TRUE, error);
+       MonoArray *arr;
+       arr = mono_array_new_specific_internal (vtable, length, TRUE, error);
        goto_if_nok (error, fail);
 
        return MONO_HANDLE_NEW (MonoArray, arr);
index 8abade8..6e73a92 100644 (file)
@@ -117,10 +117,13 @@ mono_core_preload_hook (MonoAssemblyLoadContext *alc, MonoAssemblyName *aname, c
        g_assert (aname->name);
        g_assert (!refonly);
        /* alc might be a user ALC - we get here from alc.LoadFromAssemblyName(), but we should load TPA assemblies into the default alc */
-       MonoAssemblyLoadContext *default_alc = mono_domain_default_alc (mono_alc_domain (alc));
+       MonoAssemblyLoadContext *default_alc;
+       default_alc = mono_domain_default_alc (mono_alc_domain (alc));
 
        basename = g_strconcat (aname->name, ".dll", (const char*)NULL); /* TODO: make sure CoreCLR never needs to load .exe files */
-       size_t basename_len = strlen (basename);
+
+       size_t basename_len;
+       basename_len = strlen (basename);
 
        for (int i = 0; i < a->assembly_count; ++i) {
                if (basename_len == a->basename_lens [i] && !g_strncasecmp (basename, a->basenames [i], a->basename_lens [i])) {
index 9758f29..6809abd 100644 (file)
   <ItemGroup Label="libeventpipe">
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClInclude Include="$(MonoSourceLocation)\mono\eventpipe\ep.h"/>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-block.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClInclude Include="$(MonoSourceLocation)\mono\eventpipe\ep-block.h"/>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-block-internals.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClInclude Include="$(MonoSourceLocation)\mono\eventpipe\ep-buffer.h"/>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-buffer-manager.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClInclude Include="$(MonoSourceLocation)\mono\eventpipe\ep-buffer-manager.h"/>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-buffer-manager-internals.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-config.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClInclude Include="$(MonoSourceLocation)\mono\eventpipe\ep-config.h"/>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-config-internals.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClInclude Include="$(MonoSourceLocation)\mono\eventpipe\ep-event.h"/>
     <ClInclude Include="$(MonoSourceLocation)\mono\eventpipe\ep-event-instance.h"/>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-event-instance.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-event-instance-internals.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-event-internals.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClInclude Include="$(MonoSourceLocation)\mono\eventpipe\ep-event-payload.h"/>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-event-payload-internals.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-event-source.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClInclude Include="$(MonoSourceLocation)\mono\eventpipe\ep-event-source.h"/>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-event-source-internals.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-file.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClInclude Include="$(MonoSourceLocation)\mono\eventpipe\ep-file.h"/>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-file-internals.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-internals.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-metadata-generator.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClInclude Include="$(MonoSourceLocation)\mono\eventpipe\ep-metadata-generator.h"/>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-metadata-generator-internals.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-provider.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClInclude Include="$(MonoSourceLocation)\mono\eventpipe\ep-provider.h"/>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-provider-internals.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClInclude Include="$(MonoSourceLocation)\mono\eventpipe\ep-rt.h"/>
     <ClInclude Include="$(MonoSourceLocation)\mono\eventpipe\ep-rt-config.h"/>
     <ClInclude Include="$(MonoSourceLocation)\mono\eventpipe\ep-rt-config-mono.h"/>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-rt-mono.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClInclude Include="$(MonoSourceLocation)\mono\eventpipe\ep-rt-mono.h"/>
     <ClInclude Include="$(MonoSourceLocation)\mono\eventpipe\ep-rt-types.h"/>
     <ClInclude Include="$(MonoSourceLocation)\mono\eventpipe\ep-rt-types-mono.h"/>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-thread.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClInclude Include="$(MonoSourceLocation)\mono\eventpipe\ep-thread.h"/>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-thread-internals.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClInclude Include="$(MonoSourceLocation)\mono\eventpipe\ep-types.h"/>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-session.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClInclude Include="$(MonoSourceLocation)\mono\eventpipe\ep-session.h"/>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-session-internals.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-session-provider.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClInclude Include="$(MonoSourceLocation)\mono\eventpipe\ep-session-provider-internals.h"/>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-session-provider-internals.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-stream.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClInclude Include="$(MonoSourceLocation)\mono\eventpipe\ep-stream.h"/>
     <ClCompile Include="$(MonoSourceLocation)\mono\eventpipe\ep-stream-internals.c">
       <ExcludedFromBuild>$(ExcludeEventPipeFromBuild)</ExcludedFromBuild>
-      <CompileAs>CompileAsC</CompileAs>
     </ClCompile>
     <ClInclude Include="$(MonoSourceLocation)\mono\eventpipe\ep-stack-contents.h"/>
   </ItemGroup>