[Openmp-commits] [openmp] r239323 - Removed unused functions.
Jonathan Peyton
jonathan.l.peyton at intel.com
Mon Jun 8 11:38:24 PDT 2015
Author: jlpeyton
Date: Mon Jun 8 13:38:23 2015
New Revision: 239323
URL: http://llvm.org/viewvc/llvm-project?rev=239323&view=rev
Log:
Removed unused functions.
As an ongoing effort to sanitize the openmp code, these changes remove unused functions.
The unused functions are:
__kmp_fini_allocator_thread(), __kmp_env_isDefined(), __kmp_strip_quotes(),
__kmp_convert_to_seconds(), and __kmp_convert_to_nanoseconds().
Patch by Jack Howarth
Modified:
openmp/trunk/runtime/src/kmp_runtime.c
openmp/trunk/runtime/src/kmp_settings.c
Modified: openmp/trunk/runtime/src/kmp_runtime.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_runtime.c?rev=239323&r1=239322&r2=239323&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_runtime.c (original)
+++ openmp/trunk/runtime/src/kmp_runtime.c Mon Jun 8 13:38:23 2015
@@ -553,7 +553,6 @@ __kmp_print_team_storage_map( const char
static void __kmp_init_allocator() {}
static void __kmp_fini_allocator() {}
-static void __kmp_fini_allocator_thread() {}
/* ------------------------------------------------------------------------ */
Modified: openmp/trunk/runtime/src/kmp_settings.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_settings.c?rev=239323&r1=239322&r2=239323&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_settings.c (original)
+++ openmp/trunk/runtime/src/kmp_settings.c Mon Jun 8 13:38:23 2015
@@ -23,8 +23,6 @@
#include "kmp_i18n.h"
#include "kmp_io.h"
-
-static int __kmp_env_isDefined( char const * name );
static int __kmp_env_toPrint( char const * name, int flag );
bool __kmp_env_format = 0; // 0 - old format; 1 - new format
@@ -133,21 +131,6 @@ __kmp_match_str( char const *token, char
return TRUE;
}
-static char *
-__kmp_strip_quotes( char *target, int len) {
- char *end = target + len - 1;
-
- while(*target == '"' || *target == '\'') {
- if(end <= target || (*end != '"' && *end != '\''))
- return NULL;
- *end = 0;
- --end;
- *target = 0;
- ++target;
- }
- return target;
-}
-
static size_t
__kmp_round4k( size_t size ) {
@@ -162,48 +145,6 @@ __kmp_round4k( size_t size ) {
} // __kmp_round4k
-static int
-__kmp_convert_to_seconds( char const * data )
-{
- int nvalues, value, factor;
- char mult, extra;
-
- if (data == NULL) return (0);
- value = 0;
- mult = '\0';
- nvalues = KMP_SSCANF (data, "%d%c%c", &value, &mult, &extra);
- if (nvalues < 1) return (0);
- if (nvalues == 1) mult = '\0';
- if (nvalues == 3) return (-1);
-
- switch (mult) {
- case 's': case 'S':
- factor = 1;
- break;
- case '\0':
- factor = 60;
- break;
- case 'm': case 'M':
- factor = 60;
- break;
- case 'h': case 'H':
- factor = 60 * 60;
- break;
- case 'd': case 'D':
- factor = 24 * 60 * 60;
- break;
- default:
- return (-1);
- }
-
- if (value > (INT_MAX / factor))
- value = INT_MAX;
- else
- value *= factor;
-
- return value;
-}
-
/*
Here, multipliers are like __kmp_convert_to_seconds, but floating-point
values are allowed, and the return value is in milliseconds. The default
@@ -257,58 +198,6 @@ __kmp_convert_to_milliseconds( char cons
return ret;
}
-static kmp_uint64
-__kmp_convert_to_nanoseconds( // R: Time in nanoseconds, or ~0 in case of error.
- char const * str // I: String representing time.
-) {
-
- double value; // Parsed value.
- char unit; // Unit: 's', 'm', 'u', or 'n'.
- char extra; // Buffer for extra character (if any).
- int rc; // Return code of sscanf().
- double factor; // Numeric factor corresponding to unit.
- kmp_uint64 result;
-
- if ( str == NULL || str[ 0 ] == 0 ) { // No string or empty string.
- return 0; // Default value.
- }; // if
- rc = KMP_SSCANF( str, "%lf%c%c", &value, &unit, &extra );
- switch ( rc ) {
- case 0: { // Value is not parsed.
- return ~ 0;
- } break;
- case 1: { // One value parsed, no unit is specified.
- unit = 's'; // Use default unit.
- } break;
- case 2: { // Value and unit are parsed.
- // Do nothing.
- } break;
- case 3: { // Extra characters is specified.
- return ~ 0;
- } break;
- }; // switch
- switch ( unit ) {
- case 's': {
- factor = 1.0E+9;
- } break;
- case 'm': {
- factor = 1.0E+6;
- } break;
- case 'u': {
- factor = 1.0E+3;
- } break;
- case 'n': {
- factor = 1.0;
- } break;
- default: { // Illegal unit.
- return ~ 0; // Return error.
- } break;
- }; // switch
- result = (kmp_uint64)( value * factor );
- return result;
-
-}; // func __kmp_convert_to_nanoseconds
-
static int
__kmp_strcasecmp_with_sentinel( char const * a, char const * b, char sentinel ) {
@@ -4869,17 +4758,6 @@ __kmp_stg_check_rivals( // 0 --
}; // __kmp_stg_check_rivals
-
-static int
-__kmp_env_isDefined( char const * name ) {
- int rc = 0;
- kmp_setting_t * setting = __kmp_stg_find( name );
- if ( setting != NULL ) {
- rc = setting->set;
- }; // if
- return rc;
-}
-
static int
__kmp_env_toPrint( char const * name, int flag ) {
int rc = 0;
More information about the Openmp-commits
mailing list