Add a number of symbol names to list to make internal after loading builtins.
Fixes issue #131; because they weren't being marked as internal before, when compiling to multiple targets these would lead to multiply-defined symbols.
This commit is contained in:
@@ -311,8 +311,12 @@ lCheckModuleIntrinsics(llvm::Module *module) {
|
|||||||
static void
|
static void
|
||||||
lSetInternalFunctions(llvm::Module *module) {
|
lSetInternalFunctions(llvm::Module *module) {
|
||||||
const char *names[] = {
|
const char *names[] = {
|
||||||
|
"__add_float",
|
||||||
|
"__add_int32",
|
||||||
|
"__add_uniform_double",
|
||||||
"__add_uniform_int32",
|
"__add_uniform_int32",
|
||||||
"__add_uniform_int64",
|
"__add_uniform_int64",
|
||||||
|
"__add_varying_double",
|
||||||
"__add_varying_int32",
|
"__add_varying_int32",
|
||||||
"__add_varying_int64",
|
"__add_varying_int64",
|
||||||
"__aos_to_soa3_float",
|
"__aos_to_soa3_float",
|
||||||
@@ -543,6 +547,10 @@ lSetInternalFunctions(llvm::Module *module) {
|
|||||||
"__svml_pow",
|
"__svml_pow",
|
||||||
"__undef_uniform",
|
"__undef_uniform",
|
||||||
"__undef_varying",
|
"__undef_varying",
|
||||||
|
"__vec4_add_float",
|
||||||
|
"__vec4_add_int32",
|
||||||
|
"__vselect_float",
|
||||||
|
"__vselect_i32",
|
||||||
};
|
};
|
||||||
|
|
||||||
int count = sizeof(names) / sizeof(names[0]);
|
int count = sizeof(names) / sizeof(names[0]);
|
||||||
|
|||||||
2
expr.cpp
2
expr.cpp
@@ -3157,7 +3157,7 @@ IndexExpr::GetLValue(FunctionEmitContext *ctx) const {
|
|||||||
for (int i = 0; i < count; ++i) {
|
for (int i = 0; i < count; ++i) {
|
||||||
if (indices[i] < 0 || indices[i] >= nElements)
|
if (indices[i] < 0 || indices[i] >= nElements)
|
||||||
Warning(index->pos, "Array index \"%d\" may be out of bounds for "
|
Warning(index->pos, "Array index \"%d\" may be out of bounds for "
|
||||||
"\"%d\" element array.", indices[i], nElements);
|
"%d element array.", indices[i], nElements);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user