diff options
author | David Robillard <d@drobilla.net> | 2009-06-27 03:32:57 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-06-27 03:32:57 +0000 |
commit | 7ee03dcd4fa9bdbd94678f044133ba852c152532 (patch) | |
tree | 3406f608db74e4d4dc90f2810162df4e27233664 | |
parent | b5bd4e2d4295800ef845de1857ed4e4a0994b0b6 (diff) | |
download | resp-7ee03dcd4fa9bdbd94678f044133ba852c152532.tar.gz resp-7ee03dcd4fa9bdbd94678f044133ba852c152532.tar.bz2 resp-7ee03dcd4fa9bdbd94678f044133ba852c152532.zip |
Better error messages.
git-svn-id: http://svn.drobilla.net/resp/tuplr@157 ad02d1e2-f140-0410-9f75-f8b11f17cedd
-rw-r--r-- | llvm.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -88,11 +88,12 @@ struct LLVMEngine : public Engine { vector<const Type*> cprot; for (size_t i = 0; i < argsT.size(); ++i) { AType* at = argsT.at(i)->as<AType*>(); - 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) |