From 7ee03dcd4fa9bdbd94678f044133ba852c152532 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 27 Jun 2009 03:32:57 +0000 Subject: Better error messages. git-svn-id: http://svn.drobilla.net/resp/tuplr@157 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- llvm.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/llvm.cpp b/llvm.cpp index 1d97b96..053e2e2 100644 --- a/llvm.cpp +++ b/llvm.cpp @@ -88,11 +88,12 @@ struct LLVMEngine : public Engine { vector cprot; for (size_t i = 0; i < argsT.size(); ++i) { AType* at = argsT.at(i)->as(); - THROW_IF(!llType(at), Cursor(), "function parameter is untyped") + THROW_IF(!llType(at), Cursor(), string("parameter has non-concrete type ") + + at->str()) cprot.push_back(llType(at)); } - THROW_IF(!llType(retT), Cursor(), "function return is untyped"); + THROW_IF(!llType(retT), Cursor(), "return has non-concrete type"); FunctionType* fT = FunctionType::get(llType(retT), cprot, false); Function* f = Function::Create(fT, linkage, name, module); @@ -138,7 +139,7 @@ struct LLVMEngine : public Engine { void* fp = engine->getPointerToFunction(llFunc(f)); const Type* t = llType(retT); THROW_IF(!fp, Cursor(), "unable to get function pointer"); - THROW_IF(!t, Cursor(), "function with non-primitive return type called"); + THROW_IF(!t, Cursor(), "function with non-concrete return type called"); std::stringstream ss; if (t == Type::Int32Ty) -- cgit v1.2.1