Changeset 139758 in webkit


Ignore:
Timestamp:
Jan 15, 2013 10:56:19 AM (11 years ago)
Author:
ddkilzer@apple.com
Message:

ANGLE should build with -Wshorten-64-to-32
<http://webkit.org/b/106798>
<http://code.google.com/p/angleproject/issues/detail?id=396>

Reviewed by Kenneth Russell.

Most changes below are simply to document issues with #pragma
statements per request by upstream. The change to osinclude.h
is the only bug fix, which defines OS_TLSIndex in terms of
pthread_key_t instead of unsigned int since pthread_key_t is a
64-bit value on 64-bit Mac OS X.

  • Configurations/Base.xcconfig: Enable -Wshorten-64-to-32 by

setting GCC_WARN_64_TO_32_BIT_CONVERSION to YES.

  • src/compiler/Intermediate.cpp:

(TIntermTraverser::hash): Add #pragmas for clang to ignore
-Wshorten-64-to-32 warning.

  • src/compiler/MapLongVariableNames.cpp:

(LongNameMap::Size): Ditto.

  • src/compiler/ShaderLang.cpp:

(getVariableInfo): Ditto.
(ShGetInfo): Ditto.

  • src/compiler/ValidateLimitations.cpp:

(ValidateLimitations::validateFunctionCall): Ditto.

  • src/compiler/glslang.l: Ditto.
  • src/compiler/glslang_lex.cpp: Ditto.
  • src/compiler/osinclude.h: Change type of OS_TLSIndex to

pthread_key_t. Define OS_INVALID_TLS_INDEX by using
static_cast<OS_TLSIndex>(-1).

  • src/compiler/preprocessor/Input.cpp:

(pp::Input::Input): Add #pragmas for clang to ignore
-Wshorten-64-to-32 warning.

  • src/compiler/preprocessor/Tokenizer.cpp: Ditto.
  • src/compiler/preprocessor/Tokenizer.l: Ditto.
Location:
trunk/Source/ThirdParty/ANGLE
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/ThirdParty/ANGLE/ChangeLog

    r139717 r139758  
     12013-01-15  David Kilzer  <ddkilzer@apple.com>
     2
     3        ANGLE should build with -Wshorten-64-to-32
     4        <http://webkit.org/b/106798>
     5        <http://code.google.com/p/angleproject/issues/detail?id=396>
     6
     7        Reviewed by Kenneth Russell.
     8
     9        Most changes below are simply to document issues with #pragma
     10        statements per request by upstream.  The change to osinclude.h
     11        is the only bug fix, which defines OS_TLSIndex in terms of
     12        pthread_key_t instead of unsigned int since pthread_key_t is a
     13        64-bit value on 64-bit Mac OS X.
     14
     15        * Configurations/Base.xcconfig: Enable -Wshorten-64-to-32 by
     16        setting GCC_WARN_64_TO_32_BIT_CONVERSION to YES.
     17        * src/compiler/Intermediate.cpp:
     18        (TIntermTraverser::hash): Add #pragmas for clang to ignore
     19        -Wshorten-64-to-32 warning.
     20        * src/compiler/MapLongVariableNames.cpp:
     21        (LongNameMap::Size): Ditto.
     22        * src/compiler/ShaderLang.cpp:
     23        (getVariableInfo): Ditto.
     24        (ShGetInfo): Ditto.
     25        * src/compiler/ValidateLimitations.cpp:
     26        (ValidateLimitations::validateFunctionCall): Ditto.
     27        * src/compiler/glslang.l: Ditto.
     28        * src/compiler/glslang_lex.cpp: Ditto.
     29        * src/compiler/osinclude.h: Change type of OS_TLSIndex to
     30        pthread_key_t.  Define OS_INVALID_TLS_INDEX by using
     31        static_cast<OS_TLSIndex>(-1).
     32        * src/compiler/preprocessor/Input.cpp:
     33        (pp::Input::Input): Add #pragmas for clang to ignore
     34        -Wshorten-64-to-32 warning.
     35        * src/compiler/preprocessor/Tokenizer.cpp: Ditto.
     36        * src/compiler/preprocessor/Tokenizer.l: Ditto.
     37
    1382013-01-14  David Kilzer  <ddkilzer@apple.com>
    239
  • trunk/Source/ThirdParty/ANGLE/Configurations/Base.xcconfig

    r132925 r139758  
    2020GCC_TREAT_WARNINGS_AS_ERRORS = YES;
    2121GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
     22GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
    2223GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
    2324GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
  • trunk/Source/ThirdParty/ANGLE/src/compiler/Intermediate.cpp

    r139665 r139758  
    14521452    if (hashFunction == NULL || name.empty())
    14531453        return name;
     1454#if defined(__clang__)
     1455#pragma clang diagnostic push
     1456#pragma clang diagnostic ignored "-Wshorten-64-to-32"
     1457#endif
    14541458    khronos_uint64_t number = (*hashFunction)(name.c_str(), name.length());
     1459#if defined(__clang__)
     1460#pragma clang diagnostic pop
     1461#endif
    14551462    TStringStream stream;
    14561463    stream << HASHED_NAME_PREFIX << std::hex << number;
  • trunk/Source/ThirdParty/ANGLE/src/compiler/MapLongVariableNames.cpp

    r122870 r139758  
    7373int LongNameMap::Size() const
    7474{
     75#if defined(__clang__)
     76#pragma clang diagnostic push
     77#pragma clang diagnostic ignored "-Wshorten-64-to-32"
     78#endif
    7579    return mLongNameMap.size();
     80#if defined(__clang__)
     81#pragma clang diagnostic pop
     82#endif
    7683}
    7784
  • trunk/Source/ThirdParty/ANGLE/src/compiler/ShaderLang.cpp

    r139665 r139758  
    6363
    6464    const TVariableInfo& varInfo = varList[index];
     65#if defined(__clang__)
     66#pragma clang diagnostic push
     67#pragma clang diagnostic ignored "-Wshorten-64-to-32"
     68#endif
    6569    if (length) *length = varInfo.name.size();
     70#if defined(__clang__)
     71#pragma clang diagnostic pop
     72#endif
    6673    *size = varInfo.size;
    6774    *type = varInfo.type;
     
    212219        break;
    213220    case SH_ACTIVE_UNIFORMS:
     221#if defined(__clang__)
     222#pragma clang diagnostic push
     223#pragma clang diagnostic ignored "-Wshorten-64-to-32"
     224#endif
    214225        *params = compiler->getUniforms().size();
     226#if defined(__clang__)
     227#pragma clang diagnostic pop
     228#endif
    215229        break;
    216230    case SH_ACTIVE_UNIFORM_MAX_LENGTH:
     
    218232        break;
    219233    case SH_ACTIVE_ATTRIBUTES:
     234#if defined(__clang__)
     235#pragma clang diagnostic push
     236#pragma clang diagnostic ignored "-Wshorten-64-to-32"
     237#endif
    220238        *params = compiler->getAttribs().size();
     239#if defined(__clang__)
     240#pragma clang diagnostic pop
     241#endif
    221242        break;
    222243    case SH_ACTIVE_ATTRIBUTE_MAX_LENGTH:
     
    242263        break;
    243264    case SH_HASHED_NAMES_COUNT:
     265#if defined(__clang__)
     266#pragma clang diagnostic push
     267#pragma clang diagnostic ignored "-Wshorten-64-to-32"
     268#endif
    244269        *params = compiler->getNameMap().size();
     270#if defined(__clang__)
     271#pragma clang diagnostic pop
     272#endif
    245273        break;
    246274    default: UNREACHABLE();
  • trunk/Source/ThirdParty/ANGLE/src/compiler/ValidateLimitations.cpp

    r122870 r139758  
    428428        TIntermSymbol* symbol = params[i]->getAsSymbolNode();
    429429        if (symbol && isLoopIndex(symbol))
     430#if defined(__clang__)
     431#pragma clang diagnostic push
     432#pragma clang diagnostic ignored "-Wshorten-64-to-32"
     433#endif
    430434            pIndex.push_back(i);
     435#if defined(__clang__)
     436#pragma clang diagnostic pop
     437#endif
    431438    }
    432439    // If none of the loop indices are used as arguments,
  • trunk/Source/ThirdParty/ANGLE/src/compiler/glslang.l

    r139665 r139758  
    2424
    2525// Ignore errors in auto-generated code.
     26#if defined(__clang__)
     27#pragma clang diagnostic ignored "-Wshorten-64-to-32"
     28#endif
    2629#if defined(__GNUC__)
    2730#pragma GCC diagnostic ignored "-Wunused-function"
  • trunk/Source/ThirdParty/ANGLE/src/compiler/glslang_lex.cpp

    r139665 r139758  
    99
    1010// Ignore errors in auto-generated code.
     11#if defined(__clang__)
     12#pragma clang diagnostic ignored "-Wshorten-64-to-32"
     13#endif
    1114#if defined(__GNUC__)
    1215#pragma GCC diagnostic ignored "-Wunused-function"
  • trunk/Source/ThirdParty/ANGLE/src/compiler/osinclude.h

    r139665 r139758  
    4545#define OS_INVALID_TLS_INDEX (TLS_OUT_OF_INDEXES)
    4646#elif defined(ANGLE_OS_POSIX)
    47 typedef unsigned int OS_TLSIndex;
    48 #define OS_INVALID_TLS_INDEX 0xFFFFFFFF
     47typedef pthread_key_t OS_TLSIndex;
     48#define OS_INVALID_TLS_INDEX (static_cast<OS_TLSIndex>(-1))
    4949#endif  // ANGLE_OS_WIN
    5050
  • trunk/Source/ThirdParty/ANGLE/src/compiler/preprocessor/Input.cpp

    r139665 r139758  
    2727    {
    2828        int len = length ? length[i] : -1;
     29#if defined(__clang__)
     30#pragma clang diagnostic push
     31#pragma clang diagnostic ignored "-Wshorten-64-to-32"
     32#endif
    2933        mLength.push_back(len < 0 ? std::strlen(mString[i]) : len);
     34#if defined(__clang__)
     35#pragma clang diagnostic pop
     36#endif
    3037    }
    3138}
  • trunk/Source/ThirdParty/ANGLE/src/compiler/preprocessor/Tokenizer.cpp

    r139665 r139758  
    521521#include "Token.h"
    522522
     523#if defined(__clang__)
     524#pragma clang diagnostic ignored "-Wshorten-64-to-32"
     525#endif
    523526#if defined(__GNUC__)
    524527// Triggered by the auto-generated yy_fatal_error function.
  • trunk/Source/ThirdParty/ANGLE/src/compiler/preprocessor/Tokenizer.l

    r139665 r139758  
    2929#include "Token.h"
    3030
     31#if defined(__clang__)
     32#pragma clang diagnostic ignored "-Wshorten-64-to-32"
     33#endif
    3134#if defined(__GNUC__)
    3235// Triggered by the auto-generated yy_fatal_error function.
Note: See TracChangeset for help on using the changeset viewer.