Fix typos

llvm-svn: 202018
diff --git a/openmp/runtime/src/extractExternal.cpp b/openmp/runtime/src/extractExternal.cpp
index f9cbaa4..3f15c8e 100644
--- a/openmp/runtime/src/extractExternal.cpp
+++ b/openmp/runtime/src/extractExternal.cpp
@@ -301,7 +301,7 @@
     }
 }
 
-/* For each occurence of an external symbol in the object file named by
+/* For each occurrence of an external symbol in the object file named by
    by <fileName> that is a member of <hide>, renames it by prefixing
    with "__kmp_external_", writing back the file in-place
 */
diff --git a/openmp/runtime/src/i18n/en_US.txt b/openmp/runtime/src/i18n/en_US.txt
index 62ff92a..e172d3e 100644
--- a/openmp/runtime/src/i18n/en_US.txt
+++ b/openmp/runtime/src/i18n/en_US.txt
@@ -259,7 +259,7 @@
 TLSSetValueFailed            "Windows* OS: TLS Set Value failed."
 TLSOutOfIndexes              "Windows* OS: TLS out of indexes."
 OBSOLETE                     "PDONE directive must be nested within a DO directive."
-CantGetNumAvailCPU           "Cannot get number of availabe CPUs."
+CantGetNumAvailCPU           "Cannot get number of available CPUs."
 AssumedNumCPU                "Assumed number of CPUs is 2."
 ErrorInitializeAffinity      "Error initializing affinity - not using affinity."
 AffThreadsMayMigrate         "Threads may migrate across all available OS procs (granularity setting too coarse)."
diff --git a/openmp/runtime/src/kmp.h b/openmp/runtime/src/kmp.h
index 37c7f41..777a009 100644
--- a/openmp/runtime/src/kmp.h
+++ b/openmp/runtime/src/kmp.h
@@ -1179,7 +1179,7 @@
     kmp_int32                     tq_hiwat;             /*  high-water mark for tq_nfull and queue scheduling  */
     volatile kmp_int32            tq_flags;             /*  TQF_xxx  */
 
-        /* bookkeeping for oustanding thunks */
+        /* bookkeeping for outstanding thunks */
     struct kmpc_aligned_int32_t  *tq_th_thunks;         /*  per-thread array for # of regular thunks currently being executed */
     kmp_int32                     tq_nproc;             /*  number of thunks in the th_thunks array */
 
@@ -2305,7 +2305,7 @@
 
 typedef struct KMP_ALIGN_CACHE kmp_base_team {
 /*
- * Syncronization Data
+ * Synchronization Data
  */
     KMP_ALIGN_CACHE kmp_ordered_team_t       t_ordered;
     kmp_balign_team_t        t_bar[ bs_last_barrier ];
diff --git a/openmp/runtime/src/kmp_affinity.cpp b/openmp/runtime/src/kmp_affinity.cpp
index 644251d..17baaaa 100644
--- a/openmp/runtime/src/kmp_affinity.cpp
+++ b/openmp/runtime/src/kmp_affinity.cpp
@@ -320,7 +320,7 @@
 // When sorting by labels, __kmp_affinity_assign_child_nums() must first be
 // called to renumber the labels from [0..n] and place them into the child_num
 // vector of the address object.  This is done in case the labels used for
-// the children at one node of the heirarchy differ from those used for
+// the children at one node of the hierarchy differ from those used for
 // another node at the same level.  Example:  suppose the machine has 2 nodes
 // with 2 packages each.  The first node contains packages 601 and 602, and
 // second node contains packages 603 and 604.  If we try to sort the table
@@ -1740,7 +1740,7 @@
 
     //
     // Scan of the file, and count the number of "processor" (osId) fields,
-    // and find the higest value of <n> for a node_<n> field.
+    // and find the highest value of <n> for a node_<n> field.
     //
     char buf[256];
     unsigned num_records = 0;
@@ -2512,7 +2512,7 @@
     KMP_CPU_SET(address2os[0].second, sum);
     for (i = 1; i < numAddrs; i++) {
         //
-        // If this thread is sufficiently close to the leader (withing the
+        // If this thread is sufficiently close to the leader (within the
         // granularity setting), then set the bit for this os thread in the
         // affinity mask for this group, and go on to the next thread.
         //
@@ -3368,7 +3368,7 @@
     kmp_i18n_id_t msg_id = kmp_i18n_null;
 
     //
-    // For backward compatiblity, setting KMP_CPUINFO_FILE =>
+    // For backward compatibility, setting KMP_CPUINFO_FILE =>
     // KMP_TOPOLOGY_METHOD=cpuinfo
     //
     if ((__kmp_cpuinfo_file != NULL) &&
@@ -4055,7 +4055,7 @@
       gtid, th->th.th_new_place, th->th.th_current_place));
 
     //
-    // Check that the new place is withing this thread's partition.
+    // Check that the new place is within this thread's partition.
     //
     KMP_DEBUG_ASSERT(th->th.th_affin_mask != NULL);
     KMP_DEBUG_ASSERT(th->th.th_new_place >= 0);
diff --git a/openmp/runtime/src/kmp_dispatch.cpp b/openmp/runtime/src/kmp_dispatch.cpp
index cb5bdac..0225305 100644
--- a/openmp/runtime/src/kmp_dispatch.cpp
+++ b/openmp/runtime/src/kmp_dispatch.cpp
@@ -260,7 +260,7 @@
     Does NOT put threads to sleep.
 #if USE_ITT_BUILD
     Arguments:
-        obj -- is higher-level syncronization object to report to ittnotify. It is used to report
+        obj -- is higher-level synchronization object to report to ittnotify. It is used to report
             locks consistently. For example, if lock is acquired immediately, its address is
             reported to ittnotify via KMP_FSYNC_ACQUIRED(). However, it lock cannot be acquired
             immediately and lock routine calls to KMP_WAIT_YIELD(), the later should report the same
diff --git a/openmp/runtime/src/kmp_ftn_entry.h b/openmp/runtime/src/kmp_ftn_entry.h
index dbbca19..5dc792a 100644
--- a/openmp/runtime/src/kmp_ftn_entry.h
+++ b/openmp/runtime/src/kmp_ftn_entry.h
@@ -30,13 +30,13 @@
 #endif // __cplusplus
 
 /*
- * For compatiblity with the Gnu/MS Open MP codegen, omp_set_num_threads(),
+ * For compatibility with the Gnu/MS Open MP codegen, omp_set_num_threads(),
  * omp_set_nested(), and omp_set_dynamic() [in lowercase on MS, and w/o
  * a trailing underscore on Linux* OS] take call by value integer arguments.
  * + omp_set_max_active_levels()
  * + omp_set_schedule()
  *
- * For backward compatiblity with 9.1 and previous Intel compiler, these
+ * For backward compatibility with 9.1 and previous Intel compiler, these
  * entry points take call by reference integer arguments.
  */
 #ifdef KMP_GOMP_COMPAT
diff --git a/openmp/runtime/src/kmp_global.c b/openmp/runtime/src/kmp_global.c
index b27b1716..583e299 100644
--- a/openmp/runtime/src/kmp_global.c
+++ b/openmp/runtime/src/kmp_global.c
@@ -358,7 +358,7 @@
 kmp_global_t __kmp_global = {{ 0 }};
 
 /* ----------------------------------------------- */
-/* GLOBAL SYNCRONIZATION LOCKS */
+/* GLOBAL SYNCHRONIZATION LOCKS */
 /* TODO verify the need for these locks and if they need to be global */
 KMP_ALIGN_CACHE
 
diff --git a/openmp/runtime/src/kmp_i18n.c b/openmp/runtime/src/kmp_i18n.c
index 5cca6e8..8a89d0a 100644
--- a/openmp/runtime/src/kmp_i18n.c
+++ b/openmp/runtime/src/kmp_i18n.c
@@ -361,7 +361,7 @@
                 reinterpret_cast< LPCSTR >( & __kmp_i18n_do_catopen ),
                 & handle
             );
-        if ( ! brc ) {    // Error occured.
+        if ( ! brc ) {    // Error occurred.
             status = KMP_I18N_ABSENT;  // mark catalog as absent so it will not be re-opened.
             goto end;
             // TODO: Enable multiple messages (KMP_MSG) to be passed to __kmp_msg; and print
@@ -371,7 +371,7 @@
         // Now get path to the our DLL.
         for ( ; ; ) {
             DWORD drc = GetModuleFileName( handle, path.str, path.size );
-            if ( drc == 0 ) {    // Error occured.
+            if ( drc == 0 ) {    // Error occurred.
                 status = KMP_I18N_ABSENT;
                 goto end;
             }; // if
@@ -473,7 +473,7 @@
 /*
     We use FormatMessage() to get strings from catalog, get system error messages, etc.
     FormatMessage() tends to return Windows* OS-style end-of-lines, "\r\n". When string is printed,
-    printf() also replaces all the occurences of "\n" with "\r\n" (again!), so sequences like
+    printf() also replaces all the occurrences of "\n" with "\r\n" (again!), so sequences like
     "\r\r\r\n" appear in output. It is not too good.
 
     Additional mess comes from message catalog: Our catalog source en_US.mc file (generated by
@@ -492,7 +492,7 @@
     Thus, stripping all "\r" normalizes string and returns it to canonical form, so printf() will
     produce correct end-of-line sequences.
 
-    ___strip_crs() serves for this purpose: it removes all the occurences of "\r" in-place and
+    ___strip_crs() serves for this purpose: it removes all the occurrences of "\r" in-place and
     returns new length of string.
 */
 static
diff --git a/openmp/runtime/src/kmp_itt.inl b/openmp/runtime/src/kmp_itt.inl
index 6976e7f..56953d0 100644
--- a/openmp/runtime/src/kmp_itt.inl
+++ b/openmp/runtime/src/kmp_itt.inl
@@ -515,7 +515,7 @@
 
         * __kmp_itt_lock_creating( lock ) should be called *before* the first lock operation
           (set/unset). It is not a real event shown to the user but just setting a name for
-          syncronization object. `lock' is an address of sync object, the same address should be
+          synchronization object. `lock' is an address of sync object, the same address should be
           used in all subsequent calls.
 
         * __kmp_itt_lock_acquiring() should be called before setting the lock.
diff --git a/openmp/runtime/src/kmp_lock.cpp b/openmp/runtime/src/kmp_lock.cpp
index 766cf83..4c92463 100644
--- a/openmp/runtime/src/kmp_lock.cpp
+++ b/openmp/runtime/src/kmp_lock.cpp
@@ -484,7 +484,7 @@
         KA_TRACE( 1000, ("__kmp_acquire_futex_lock: lck:%p, T#%d after futex_wait(0x%x)\n",
            lck, gtid, poll_val ) );
         //
-        // This thread has now done a succesful futex wait call and was
+        // This thread has now done a successful futex wait call and was
         // entered on the OS futex queue.  We must now perform a futex
         // wake call when releasing the lock, as we have no idea how many
         // other threads are in the queue.
@@ -2548,7 +2548,7 @@
 
         //
         // If we are oversubscribed,
-        // or ahve waited a bit (and KMP_LIBRARY=turnaround), then yield.
+        // or have waited a bit (and KMP_LIBRARY=turnaround), then yield.
         // CPU Pause is in the macros for yield.
         //
         KMP_YIELD(TCR_4(__kmp_nth)
@@ -2733,7 +2733,7 @@
             lck->lk.now_serving = ticket;               // non-volatile store
 
             //
-            // Since no threads are waiting, there is no possiblity that
+            // Since no threads are waiting, there is no possibility that
             // we would want to reconfigure the polling area.  We might
             // have the cleanup ticket value (which says that it is now
             // safe to deallocate old_polls), but we'll let a later thread
diff --git a/openmp/runtime/src/kmp_lock.h b/openmp/runtime/src/kmp_lock.h
index 5191cea..8009d18 100644
--- a/openmp/runtime/src/kmp_lock.h
+++ b/openmp/runtime/src/kmp_lock.h
@@ -415,7 +415,7 @@
 
     //
     // now_serving is used to store our ticket value while we hold the lock.
-    // It has a slighly different meaning in the DRDPA ticket locks (where
+    // It has a slightly different meaning in the DRDPA ticket locks (where
     // it is written by the acquiring thread) than it does in the simple
     // ticket locks (where it is written by the releasing thread).
     //
diff --git a/openmp/runtime/src/kmp_runtime.c b/openmp/runtime/src/kmp_runtime.c
index 37c372b..729d66b 100644
--- a/openmp/runtime/src/kmp_runtime.c
+++ b/openmp/runtime/src/kmp_runtime.c
@@ -1987,7 +1987,7 @@
         }; // if
 
 #if USE_ITT_BUILD
-        // TODO: In case of split reduction barrier, master thread may send aquired event early,
+        // TODO: In case of split reduction barrier, master thread may send acquired event early,
         // before the final summation into the shared variable is done (final summation can be a
         // long operation for array reductions).
         if ( __itt_sync_create_ptr || KMP_ITT_DEBUG )
@@ -4366,7 +4366,7 @@
             added += newCapacity - __kmp_threads_capacity;
             *(volatile int*)&__kmp_threads_capacity = newCapacity;
             __kmp_release_bootstrap_lock(&__kmp_tp_cached_lock);
-            break; /* succeded, so we can exit the loop */
+            break; /* succeeded, so we can exit the loop */
         }
     }
     return added;
@@ -4458,7 +4458,7 @@
 
 #ifdef KMP_ADJUST_BLOCKTIME
     /* Adjust blocktime to zero if necessary            */
-    /* Middle initialization might not have ocurred yet */
+    /* Middle initialization might not have occurred yet */
     if ( !__kmp_env_blocktime && ( __kmp_avail_proc > 0 ) ) {
         if ( __kmp_nth > __kmp_avail_proc ) {
             __kmp_zero_bt = TRUE;
@@ -4863,7 +4863,7 @@
 
 #ifdef KMP_ADJUST_BLOCKTIME
         /* Adjust blocktime back to zero if necessar      y */
-        /* Middle initialization might not have ocurred yet */
+        /* Middle initialization might not have occurred yet */
         if ( !__kmp_env_blocktime && ( __kmp_avail_proc > 0 ) ) {
             if ( __kmp_nth > __kmp_avail_proc ) {
                 __kmp_zero_bt = TRUE;
@@ -5016,7 +5016,7 @@
 
 #ifdef KMP_ADJUST_BLOCKTIME
     /* Adjust blocktime back to zero if necessary       */
-    /* Middle initialization might not have ocurred yet */
+    /* Middle initialization might not have occurred yet */
     if ( !__kmp_env_blocktime && ( __kmp_avail_proc > 0 ) ) {
         if ( __kmp_nth > __kmp_avail_proc ) {
             __kmp_zero_bt = TRUE;
@@ -5253,7 +5253,7 @@
 //
 // __kmp_partition_places() is the heart of the OpenMP 4.0 affinity mechanism.
 // It calculats the worker + master thread's partition based upon the parent
-// thread's partition, and binds each worker to a thread in thier partition.
+// thread's partition, and binds each worker to a thread in their partition.
 // The master thread's partition should already include its current binding.
 //
 static void
@@ -6152,7 +6152,7 @@
 
 #ifdef KMP_ADJUST_BLOCKTIME
     /* Adjust blocktime back to user setting or default if necessary */
-    /* Middle initialization might never have ocurred                */
+    /* Middle initialization might never have occurred                */
     if ( !__kmp_env_blocktime && ( __kmp_avail_proc > 0 ) ) {
         KMP_DEBUG_ASSERT( __kmp_avail_proc > 0 );
         if ( __kmp_nth <= __kmp_avail_proc ) {
@@ -6691,7 +6691,7 @@
     int is_root
 ) {
 
-    // It is assumed __kmp_forkjoin_lock is aquired.
+    // It is assumed __kmp_forkjoin_lock is acquired.
 
     int gtid;
 
@@ -6756,7 +6756,7 @@
 
 #ifdef KMP_ADJUST_BLOCKTIME
     /* Adjust blocktime back to user setting or default if necessary */
-    /* Middle initialization might never have ocurred                */
+    /* Middle initialization might never have occurred                */
     if ( !__kmp_env_blocktime && ( __kmp_avail_proc > 0 ) ) {
         KMP_DEBUG_ASSERT( __kmp_avail_proc > 0 );
         if ( __kmp_nth <= __kmp_avail_proc ) {
diff --git a/openmp/runtime/src/kmp_settings.c b/openmp/runtime/src/kmp_settings.c
index 3a0f6ce..3e1fffc 100644
--- a/openmp/runtime/src/kmp_settings.c
+++ b/openmp/runtime/src/kmp_settings.c
@@ -210,7 +210,7 @@
     Here, multipliers are like __kmp_convert_to_seconds, but floating-point
     values are allowed, and the return value is in milliseconds.  The default
     multiplier is milliseconds.  Returns INT_MAX only if the value specified
-    matches "infinit*".  Returns -1 if specified string is invalid.
+    matches "infinite*".  Returns -1 if specified string is invalid.
 */
 int
 __kmp_convert_to_milliseconds( char const * data )
@@ -220,7 +220,7 @@
     double value;
 
     if (data == NULL) return (-1);
-    if ( __kmp_str_match( "infinit", -1, data)) return (INT_MAX);
+    if ( __kmp_str_match( "infinite", -1, data)) return (INT_MAX);
     value = (double) 0.0;
     mult = '\0';
     nvalues = sscanf (data, "%lf%c%c", &value, &mult, &extra);
@@ -442,7 +442,7 @@
                 #endif
             }; // if
         } else {
-            // If integer overflow occured, * out == KMP_SIZE_T_MAX. Cut it to size_max silently.
+            // If integer overflow occurred, * out == KMP_SIZE_T_MAX. Cut it to size_max silently.
             if ( * out < size_min ) {
                 * out = size_max;
             }
@@ -493,7 +493,7 @@
             uint = max;
         }; // if
     } else {
-        // If overflow occured msg contains error message and uint is very big. Cut tmp it
+        // If overflow occurred msg contains error message and uint is very big. Cut tmp it
         // to INT_MAX.
         if ( uint < (unsigned int)min ) {
             uint = min;
diff --git a/openmp/runtime/src/kmp_str.c b/openmp/runtime/src/kmp_str.c
index c1f9e9b..9c0469f 100644
--- a/openmp/runtime/src/kmp_str.c
+++ b/openmp/runtime/src/kmp_str.c
@@ -226,7 +226,7 @@
             break;
         }; // if
 
-        // Error occured, buffer is too small.
+        // Error occurred, buffer is too small.
         if ( rc >= 0 ) {
             // C99-conforming implementation of vsnprintf returns required buffer size.
             size = buffer->used + rc + 1;
@@ -512,7 +512,7 @@
             break;
         }; // if
 
-        // Error occured, buffer is too small.
+        // Error occurred, buffer is too small.
         if ( rc >= 0 ) {
             // C99-conforming implementation of vsnprintf returns required buffer size.
             size = rc + 1;
diff --git a/openmp/runtime/src/kmp_tasking.c b/openmp/runtime/src/kmp_tasking.c
index 8cac009..6607577 100644
--- a/openmp/runtime/src/kmp_tasking.c
+++ b/openmp/runtime/src/kmp_tasking.c
@@ -1643,7 +1643,7 @@
             __kmp_resume( __kmp_gtid_from_thread( other_thread ), NULL );
 
             // A sleeping thread should not have any tasks on it's queue.
-            // There is a slight possiblility that it resumes, steals a task from
+            // There is a slight possibility that it resumes, steals a task from
             // another thread, which spawns more tasks, all in the that it takes
             // this thread to check => don't write an assertion that the victim's
             // queue is empty.  Try stealing from a different thread.
diff --git a/openmp/runtime/src/makefile.mk b/openmp/runtime/src/makefile.mk
index 8185e78..8d3892a1 100644
--- a/openmp/runtime/src/makefile.mk
+++ b/openmp/runtime/src/makefile.mk
@@ -1008,7 +1008,7 @@
 
 # Copy object files, wiping out references to libirc library. Object files (ours and extracted
 # from libirc.lib) have "-defaultlib:libirc.lib" linker directive, so linker will require libirc.lib
-# regardless of absense of real dependency. Actually, this rule is required only on Windows* OS, but
+# regardless of absence of real dependency. Actually, this rule is required only on Windows* OS, but
 # there is no Windows* OS-specific commands, so I omit conditions to keep code shorter and be able test
 # the rule on Linux* OS.
 # Note: If we are not going to pick up objects from libirc, there is no point in wiping out
@@ -1227,7 +1227,7 @@
             tt-libs  += $(imp_file)
         endif
         ifneq "$(arch)" "32"
-            # To succesfully build with VS2008
+            # To successfully build with VS2008
             # tt-libs += bufferoverflowu.lib
             # Preventing "unresolved external symbol __security_cookie" (and
             # "... __security_check_cookie") linker errors on win_32e and win_64.
diff --git a/openmp/runtime/src/thirdparty/ittnotify/ittnotify.h b/openmp/runtime/src/thirdparty/ittnotify/ittnotify.h
index 9df6e2f..a9988db 100644
--- a/openmp/runtime/src/thirdparty/ittnotify/ittnotify.h
+++ b/openmp/runtime/src/thirdparty/ittnotify/ittnotify.h
@@ -2044,7 +2044,7 @@
  * take the current timestamp as the end timestamp.
  * @param[in] domain The domain for this frame instance
  * @param[in] id The instance ID for this frame instance or NULL
- * @param[in] begin Timestamp of the beggining of the frame
+ * @param[in] begin Timestamp of the beginning of the frame
  * @param[in] end Timestamp of the end of the frame
  */
 void ITTAPI __itt_frame_submit_v3(const __itt_domain *domain, __itt_id *id,
diff --git a/openmp/runtime/src/thirdparty/ittnotify/legacy/ittnotify.h b/openmp/runtime/src/thirdparty/ittnotify/legacy/ittnotify.h
index 9919294..08e5bb9 100644
--- a/openmp/runtime/src/thirdparty/ittnotify/legacy/ittnotify.h
+++ b/openmp/runtime/src/thirdparty/ittnotify/legacy/ittnotify.h
@@ -428,7 +428,7 @@
  * @param[in] objname -   null-terminated object name string. If NULL, no name will be assigned
  *                        to the object -- you can use the __itt_sync_rename call later to assign
  *                        the name
- * @param[in] typelen, namelen -   a lenght of string for appropriate objtype and objname parameter
+ * @param[in] typelen, namelen -   a length of string for appropriate objtype and objname parameter
  * @param[in] attribute - one of [#__itt_attr_barrier, #__itt_attr_mutex] values which defines the
  *                        exact semantics of how prepare/acquired/releasing calls work.
  * @return __itt_err upon failure (name or namelen being null,name and namelen mismatched)
diff --git a/openmp/runtime/src/z_Linux_util.c b/openmp/runtime/src/z_Linux_util.c
index 27e394f..40a539f 100644
--- a/openmp/runtime/src/z_Linux_util.c
+++ b/openmp/runtime/src/z_Linux_util.c
@@ -227,7 +227,7 @@
     // then we don't have to search for an appropriate size.
     gCode = syscall( __NR_sched_getaffinity, 0, KMP_CPU_SET_SIZE_LIMIT, buf );
     KA_TRACE(30, ( "__kmp_affinity_determine_capable: "
-       "intial getaffinity call returned %d errno = %d\n",
+       "initial getaffinity call returned %d errno = %d\n",
        gCode, errno));
 
     //if ((gCode < 0) && (errno == ENOSYS))
@@ -2281,7 +2281,7 @@
         ret_avg = averages[1];// 5 min
     } else if ( ( __kmp_load_balance_interval >= 600 ) && ( res == 3 ) ) {
         ret_avg = averages[2];// 15 min
-    } else {// Error occured
+    } else {// Error occurred
         return -1;
     }