Title: [139758] trunk/Source/ThirdParty/ANGLE
Revision
139758
Author
ddkil...@apple.com
Date
2013-01-15 10:56:19 -0800 (Tue, 15 Jan 2013)

Log 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.

Modified Paths

Diff

Modified: trunk/Source/ThirdParty/ANGLE/ChangeLog (139757 => 139758)


--- trunk/Source/ThirdParty/ANGLE/ChangeLog	2013-01-15 18:54:27 UTC (rev 139757)
+++ trunk/Source/ThirdParty/ANGLE/ChangeLog	2013-01-15 18:56:19 UTC (rev 139758)
@@ -1,3 +1,40 @@
+2013-01-15  David Kilzer  <ddkil...@apple.com>
+
+        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.
+
 2013-01-14  David Kilzer  <ddkil...@apple.com>
 
         Remove nonexistent file in ANGLE Xcode project

Modified: trunk/Source/ThirdParty/ANGLE/Configurations/Base.xcconfig (139757 => 139758)


--- trunk/Source/ThirdParty/ANGLE/Configurations/Base.xcconfig	2013-01-15 18:54:27 UTC (rev 139757)
+++ trunk/Source/ThirdParty/ANGLE/Configurations/Base.xcconfig	2013-01-15 18:56:19 UTC (rev 139758)
@@ -19,6 +19,7 @@
 GCC_THREADSAFE_STATICS = NO;
 GCC_TREAT_WARNINGS_AS_ERRORS = YES;
 GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
 GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
 GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
 LINKER_DISPLAYS_MANGLED_NAMES = YES;

Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/Intermediate.cpp (139757 => 139758)


--- trunk/Source/ThirdParty/ANGLE/src/compiler/Intermediate.cpp	2013-01-15 18:54:27 UTC (rev 139757)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/Intermediate.cpp	2013-01-15 18:56:19 UTC (rev 139758)
@@ -1451,7 +1451,14 @@
 {
     if (hashFunction == NULL || name.empty())
         return name;
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wshorten-64-to-32"
+#endif
     khronos_uint64_t number = (*hashFunction)(name.c_str(), name.length());
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
     TStringStream stream;
     stream << HASHED_NAME_PREFIX << std::hex << number;
     TString hashedName = stream.str();

Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/MapLongVariableNames.cpp (139757 => 139758)


--- trunk/Source/ThirdParty/ANGLE/src/compiler/MapLongVariableNames.cpp	2013-01-15 18:54:27 UTC (rev 139757)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/MapLongVariableNames.cpp	2013-01-15 18:56:19 UTC (rev 139758)
@@ -72,7 +72,14 @@
 
 int LongNameMap::Size() const
 {
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wshorten-64-to-32"
+#endif
     return mLongNameMap.size();
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
 }
 
 MapLongVariableNames::MapLongVariableNames(LongNameMap* globalMap)

Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/ShaderLang.cpp (139757 => 139758)


--- trunk/Source/ThirdParty/ANGLE/src/compiler/ShaderLang.cpp	2013-01-15 18:54:27 UTC (rev 139757)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/ShaderLang.cpp	2013-01-15 18:56:19 UTC (rev 139758)
@@ -62,7 +62,14 @@
         return;
 
     const TVariableInfo& varInfo = varList[index];
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wshorten-64-to-32"
+#endif
     if (length) *length = varInfo.name.size();
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
     *size = varInfo.size;
     *type = varInfo.type;
 
@@ -211,13 +218,27 @@
         *params = compiler->getInfoSink().obj.size() + 1;
         break;
     case SH_ACTIVE_UNIFORMS:
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wshorten-64-to-32"
+#endif
         *params = compiler->getUniforms().size();
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
         break;
     case SH_ACTIVE_UNIFORM_MAX_LENGTH:
         *params = 1 +  MAX_SYMBOL_NAME_LEN;
         break;
     case SH_ACTIVE_ATTRIBUTES:
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wshorten-64-to-32"
+#endif
         *params = compiler->getAttribs().size();
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
         break;
     case SH_ACTIVE_ATTRIBUTE_MAX_LENGTH:
         *params = 1 + MAX_SYMBOL_NAME_LEN;
@@ -241,7 +262,14 @@
         }
         break;
     case SH_HASHED_NAMES_COUNT:
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wshorten-64-to-32"
+#endif
         *params = compiler->getNameMap().size();
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
         break;
     default: UNREACHABLE();
     }

Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/ValidateLimitations.cpp (139757 => 139758)


--- trunk/Source/ThirdParty/ANGLE/src/compiler/ValidateLimitations.cpp	2013-01-15 18:54:27 UTC (rev 139757)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/ValidateLimitations.cpp	2013-01-15 18:56:19 UTC (rev 139758)
@@ -427,7 +427,14 @@
     for (TIntermSequence::size_type i = 0; i < params.size(); ++i) {
         TIntermSymbol* symbol = params[i]->getAsSymbolNode();
         if (symbol && isLoopIndex(symbol))
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wshorten-64-to-32"
+#endif
             pIndex.push_back(i);
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
     }
     // If none of the loop indices are used as arguments,
     // there is nothing to check.

Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/glslang.l (139757 => 139758)


--- trunk/Source/ThirdParty/ANGLE/src/compiler/glslang.l	2013-01-15 18:54:27 UTC (rev 139757)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/glslang.l	2013-01-15 18:56:19 UTC (rev 139758)
@@ -23,6 +23,9 @@
 // This file is auto-generated by generate_parser.sh. DO NOT EDIT!
 
 // Ignore errors in auto-generated code.
+#if defined(__clang__)
+#pragma clang diagnostic ignored "-Wshorten-64-to-32"
+#endif
 #if defined(__GNUC__)
 #pragma GCC diagnostic ignored "-Wunused-function"
 #pragma GCC diagnostic ignored "-Wunused-variable"

Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/glslang_lex.cpp (139757 => 139758)


--- trunk/Source/ThirdParty/ANGLE/src/compiler/glslang_lex.cpp	2013-01-15 18:54:27 UTC (rev 139757)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/glslang_lex.cpp	2013-01-15 18:56:19 UTC (rev 139758)
@@ -8,6 +8,9 @@
 // This file is auto-generated by generate_parser.sh. DO NOT EDIT!
 
 // Ignore errors in auto-generated code.
+#if defined(__clang__)
+#pragma clang diagnostic ignored "-Wshorten-64-to-32"
+#endif
 #if defined(__GNUC__)
 #pragma GCC diagnostic ignored "-Wunused-function"
 #pragma GCC diagnostic ignored "-Wunused-variable"

Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/osinclude.h (139757 => 139758)


--- trunk/Source/ThirdParty/ANGLE/src/compiler/osinclude.h	2013-01-15 18:54:27 UTC (rev 139757)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/osinclude.h	2013-01-15 18:56:19 UTC (rev 139758)
@@ -44,8 +44,8 @@
 typedef DWORD OS_TLSIndex;
 #define OS_INVALID_TLS_INDEX (TLS_OUT_OF_INDEXES)
 #elif defined(ANGLE_OS_POSIX)
-typedef unsigned int OS_TLSIndex;
-#define OS_INVALID_TLS_INDEX 0xFFFFFFFF
+typedef pthread_key_t OS_TLSIndex;
+#define OS_INVALID_TLS_INDEX (static_cast<OS_TLSIndex>(-1))
 #endif  // ANGLE_OS_WIN
 
 OS_TLSIndex OS_AllocTLSIndex();

Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/preprocessor/Input.cpp (139757 => 139758)


--- trunk/Source/ThirdParty/ANGLE/src/compiler/preprocessor/Input.cpp	2013-01-15 18:54:27 UTC (rev 139757)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/preprocessor/Input.cpp	2013-01-15 18:56:19 UTC (rev 139758)
@@ -26,7 +26,14 @@
     for (int i = 0; i < mCount; ++i)
     {
         int len = length ? length[i] : -1;
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wshorten-64-to-32"
+#endif
         mLength.push_back(len < 0 ? std::strlen(mString[i]) : len);
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
     }
 }
 

Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/preprocessor/Tokenizer.cpp (139757 => 139758)


--- trunk/Source/ThirdParty/ANGLE/src/compiler/preprocessor/Tokenizer.cpp	2013-01-15 18:54:27 UTC (rev 139757)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/preprocessor/Tokenizer.cpp	2013-01-15 18:56:19 UTC (rev 139758)
@@ -520,6 +520,9 @@
 #include "DiagnosticsBase.h"
 #include "Token.h"
 
+#if defined(__clang__)
+#pragma clang diagnostic ignored "-Wshorten-64-to-32"
+#endif
 #if defined(__GNUC__)
 // Triggered by the auto-generated yy_fatal_error function.
 #pragma GCC diagnostic ignored "-Wmissing-noreturn"

Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/preprocessor/Tokenizer.l (139757 => 139758)


--- trunk/Source/ThirdParty/ANGLE/src/compiler/preprocessor/Tokenizer.l	2013-01-15 18:54:27 UTC (rev 139757)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/preprocessor/Tokenizer.l	2013-01-15 18:56:19 UTC (rev 139758)
@@ -28,6 +28,9 @@
 #include "DiagnosticsBase.h"
 #include "Token.h"
 
+#if defined(__clang__)
+#pragma clang diagnostic ignored "-Wshorten-64-to-32"
+#endif
 #if defined(__GNUC__)
 // Triggered by the auto-generated yy_fatal_error function.
 #pragma GCC diagnostic ignored "-Wmissing-noreturn"
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to