Mercurial > projects > ldc
comparison gen/tollvm.cpp @ 1279:04c36605feb9
Fixed array operation codegen when used from imported templates. All array operations are now emitted with template linkage. Fixed #270 .
author | Tomas Lindquist Olsen <tomas.l.olsen gmail com> |
---|---|
date | Wed, 29 Apr 2009 18:59:39 +0200 |
parents | f1877b6be63d |
children | c74dfdcc5043 |
comparison
equal
deleted
inserted
replaced
1278:8fb39f7f1a7c | 1279:04c36605feb9 |
---|---|
273 else if (FuncDeclaration* fdecl = sym->isFuncDeclaration()) | 273 else if (FuncDeclaration* fdecl = sym->isFuncDeclaration()) |
274 { | 274 { |
275 assert(fdecl->type->ty == Tfunction); | 275 assert(fdecl->type->ty == Tfunction); |
276 TypeFunction* ft = (TypeFunction*)fdecl->type; | 276 TypeFunction* ft = (TypeFunction*)fdecl->type; |
277 | 277 |
278 // array operations are always internal | 278 // array operations are always template linkage |
279 if (fdecl->isArrayOp) | 279 if (fdecl->isArrayOp) |
280 return llvm::GlobalValue::InternalLinkage; | 280 return TEMPLATE_LINKAGE_TYPE; |
281 // intrinsics are always external | 281 // intrinsics are always external |
282 if (fdecl->llvmInternal == LLVMintrinsic) | 282 if (fdecl->llvmInternal == LLVMintrinsic) |
283 return llvm::GlobalValue::ExternalLinkage; | 283 return llvm::GlobalValue::ExternalLinkage; |
284 // template instances should have weak linkage | 284 // template instances should have weak linkage |
285 // but only if there's a body, and it's not naked | 285 // but only if there's a body, and it's not naked |