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:
Matt Pharr
2011-12-07 08:30:38 -08:00
parent eaaebf7928
commit a79bc75b72
5 changed files with 14 additions and 6 deletions

View File

@@ -311,8 +311,12 @@ lCheckModuleIntrinsics(llvm::Module *module) {
static void
lSetInternalFunctions(llvm::Module *module) {
const char *names[] = {
"__add_float",
"__add_int32",
"__add_uniform_double",
"__add_uniform_int32",
"__add_uniform_int64",
"__add_varying_double",
"__add_varying_int32",
"__add_varying_int64",
"__aos_to_soa3_float",
@@ -543,6 +547,10 @@ lSetInternalFunctions(llvm::Module *module) {
"__svml_pow",
"__undef_uniform",
"__undef_varying",
"__vec4_add_float",
"__vec4_add_int32",
"__vselect_float",
"__vselect_i32",
};
int count = sizeof(names) / sizeof(names[0]);

View File

@@ -3157,7 +3157,7 @@ IndexExpr::GetLValue(FunctionEmitContext *ctx) const {
for (int i = 0; i < count; ++i) {
if (indices[i] < 0 || indices[i] >= nElements)
Warning(index->pos, "Array index \"%d\" may be out of bounds for "
"\"%d\" element array.", indices[i], nElements);
"%d element array.", indices[i], nElements);
}
}
}