Mercurial > projects > ldc
comparison gen/tollvm.c @ 18:c05ef76f1c20 trunk
[svn r22] * Forgot to add std.stdio
author | lindquist |
---|---|
date | Thu, 04 Oct 2007 01:47:53 +0200 |
parents | d3ee9efe20e2 |
children | 8d45266bbabe |
comparison
equal
deleted
inserted
replaced
17:6c6cd097bcdf | 18:c05ef76f1c20 |
---|---|
889 { | 889 { |
890 TypeFunction* f = (TypeFunction*)fdecl->type; | 890 TypeFunction* f = (TypeFunction*)fdecl->type; |
891 assert(f != 0); | 891 assert(f != 0); |
892 | 892 |
893 if (fdecl->llvmValue != 0) { | 893 if (fdecl->llvmValue != 0) { |
894 assert(llvm::isa<llvm::Function>(fdecl->llvmValue)); | 894 if (!llvm::isa<llvm::Function>(fdecl->llvmValue)) |
895 { | |
896 Logger::cout() << *fdecl->llvmValue << '\n'; | |
897 assert(0); | |
898 } | |
895 return llvm::cast<llvm::Function>(fdecl->llvmValue); | 899 return llvm::cast<llvm::Function>(fdecl->llvmValue); |
896 } | 900 } |
897 | 901 |
898 static int fdi = 0; | 902 Logger::print("FuncDeclaration::toObjFile(%s): %s\n", fdecl->needThis()?"this":"static",fdecl->toChars()); |
899 Logger::print("FuncDeclaration::toObjFile(%d,%s): %s\n", fdi++, fdecl->needThis()?"this":"static",fdecl->toChars()); | |
900 LOG_SCOPE; | 903 LOG_SCOPE; |
901 | 904 |
902 if (fdecl->llvmInternal == LLVMintrinsic && fdecl->fbody) { | 905 if (fdecl->llvmInternal == LLVMintrinsic && fdecl->fbody) { |
903 error("intrinsics cannot have function bodies"); | 906 error("intrinsics cannot have function bodies"); |
904 fatal(); | 907 fatal(); |