<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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@139758
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-01-15 David Kilzer <ddkilzer@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 <ddkilzer@apple.com>
Remove nonexistent file in ANGLE Xcode project
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;
{
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();
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)
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;
*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;
}
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();
}
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.
// 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"
// 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"
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();
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
}
}
#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"
#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"