aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-02-15 22:24:54 +0100
committerDavid Robillard <d@drobilla.net>2019-02-15 22:24:54 +0100
commitb321fb5d3d6b3c2855c2fcc049c6f3b8fb13a7a8 (patch)
tree2347b5b8d8eac8647267fb33ed35cd0f8dfabdf8
parent80801dc725dbb08c67ddee92fc742093f8c2bc7c (diff)
downloadresp-b321fb5d3d6b3c2855c2fcc049c6f3b8fb13a7a8.tar.gz
resp-b321fb5d3d6b3c2855c2fcc049c6f3b8fb13a7a8.tar.bz2
resp-b321fb5d3d6b3c2855c2fcc049c6f3b8fb13a7a8.zip
WIP: Port to LLVM7llvm7
-rw-r--r--src/c.cpp2
-rw-r--r--src/constrain.cpp44
-rw-r--r--src/llvm.cpp78
-rw-r--r--src/parse.cpp8
-rw-r--r--src/repl.cpp6
-rw-r--r--src/resp.cpp2
-rw-r--r--src/resp.hpp10
-rw-r--r--src/unify.cpp4
-rw-r--r--wscript4
9 files changed, 82 insertions, 76 deletions
diff --git a/src/c.cpp b/src/c.cpp
index c4cd397..41fabb0 100644
--- a/src/c.cpp
+++ b/src/c.cpp
@@ -123,7 +123,7 @@ CEngine::llType(const AST* t)
ret->append("}*");
return ret;
}
- throw Error(t->loc, string("Unknown compiled type `") + t->str() + "'");
+ throw RespError(t->loc, string("Unknown compiled type `") + t->str() + "'");
return NULL;
}
diff --git a/src/constrain.cpp b/src/constrain.cpp
index 8b0558f..6531ac2 100644
--- a/src/constrain.cpp
+++ b/src/constrain.cpp
@@ -25,7 +25,7 @@
#include "resp.hpp"
static void
-constrain_symbol(TEnv& tenv, Constraints& c, const ASymbol* sym) throw(Error)
+constrain_symbol(TEnv& tenv, Constraints& c, const ASymbol* sym)
{
const AST** ref = tenv.ref(sym);
THROW_IF(!ref, sym->loc, (format("undefined symbol `%1%'") % sym->sym()).str());
@@ -33,7 +33,7 @@ constrain_symbol(TEnv& tenv, Constraints& c, const ASymbol* sym) throw(Error)
}
static void
-constrain_cons(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error)
+constrain_cons(TEnv& tenv, Constraints& c, const ATuple* call)
{
const ASymbol* name = (*call->begin())->as_symbol();
@@ -89,7 +89,7 @@ constrain_cons(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error)
}
static void
-constrain_dot(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error)
+constrain_dot(TEnv& tenv, Constraints& c, const ATuple* call)
{
THROW_IF(call->list_len() != 3, call->loc, "`.' requires exactly 2 arguments");
ATuple::const_iterator i = call->begin();
@@ -111,7 +111,7 @@ constrain_dot(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error)
}
static void
-constrain_def(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error)
+constrain_def(TEnv& tenv, Constraints& c, const ATuple* call)
{
THROW_IF(call->list_len() != 3, call->loc, "`define' requires exactly 2 arguments");
THROW_IF(!call->frst()->to_symbol(), call->frst()->loc, "`define' name is not a symbol");
@@ -127,7 +127,7 @@ constrain_def(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error)
}
static void
-constrain_def_type(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error)
+constrain_def_type(TEnv& tenv, Constraints& c, const ATuple* call)
{
THROW_IF(call->list_len() < 3, call->loc, "`define-type' requires at least 2 arguments");
ATuple::const_iterator i = call->iter_at(1);
@@ -147,7 +147,7 @@ constrain_def_type(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error)
}
static void
-constrain_fn(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error)
+constrain_fn(TEnv& tenv, Constraints& c, const ATuple* call)
{
set<const ASymbol*> defs;
TEnv::Frame frame;
@@ -205,7 +205,7 @@ constrain_fn(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error)
}
static void
-constrain_if(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error)
+constrain_if(TEnv& tenv, Constraints& c, const ATuple* call)
{
THROW_IF(call->list_len() < 4, call->loc, "`if' requires at least 3 arguments");
THROW_IF(call->list_len() % 2 != 0, call->loc, "`if' missing final else clause");
@@ -227,7 +227,7 @@ constrain_if(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error)
}
static void
-constrain_match(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error)
+constrain_match(TEnv& tenv, Constraints& c, const ATuple* call)
{
THROW_IF(call->list_len() < 5, call->loc, "`match' requires at least 4 arguments");
const AST* matchee = call->list_ref(1);
@@ -275,7 +275,7 @@ constrain_match(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error)
}
static void
-resp_constrain_quoted(TEnv& tenv, Constraints& c, const AST* ast) throw(Error)
+resp_constrain_quoted(TEnv& tenv, Constraints& c, const AST* ast)
{
if (ast->tag() == T_SYMBOL) {
c.constrain(tenv, ast, tenv.named("Symbol"));
@@ -296,7 +296,7 @@ resp_constrain_quoted(TEnv& tenv, Constraints& c, const AST* ast) throw(Error)
}
static void
-constrain_quote(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error)
+constrain_quote(TEnv& tenv, Constraints& c, const ATuple* call)
{
THROW_IF(call->list_len() != 2, call->loc, "`quote' requires exactly 1 argument");
resp_constrain_quoted(tenv, c, call->frst());
@@ -305,7 +305,7 @@ constrain_quote(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error)
}
static void
-constrain_call(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error)
+constrain_call(TEnv& tenv, Constraints& c, const ATuple* call)
{
const AST* const head = call->fst();
@@ -315,7 +315,7 @@ constrain_call(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error)
const AST* fnType = tenv.var(head);
if (!AType::is_var(fnType)) {
if (!is_form(fnType, "Fn"))
- throw Error(call->loc, (format("call to non-function `%1%'") % head->str()).str());
+ throw RespError(call->loc, (format("call to non-function `%1%'") % head->str()).str());
size_t numArgs = fnType->as_tuple()->prot()->list_len();
THROW_IF(numArgs != call->list_len() - 1, call->loc,
@@ -335,7 +335,7 @@ constrain_call(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error)
}
static void
-constrain_primitive(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error)
+constrain_primitive(TEnv& tenv, Constraints& c, const ATuple* call)
{
const string n = call->fst()->to_symbol()->str();
enum { ARITHMETIC, BINARY, LOGICAL, COMPARISON } type;
@@ -348,7 +348,7 @@ constrain_primitive(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error)
else if (n == "=" || n == "!=" || n == ">" || n == ">=" || n == "<" || n == "<=")
type = COMPARISON;
else
- throw Error(call->loc, (format("unknown primitive `%1%'") % n).str());
+ throw RespError(call->loc, (format("unknown primitive `%1%'") % n).str());
ATuple::const_iterator i = call->begin();
@@ -361,37 +361,37 @@ constrain_primitive(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error)
switch (type) {
case ARITHMETIC:
if (call->list_len() < 3)
- throw Error(call->loc, (format("`%1%' requires at least 2 arguments") % n).str());
+ throw RespError(call->loc, (format("`%1%' requires at least 2 arguments") % n).str());
for (++i; i != call->end(); ++i)
c.constrain(tenv, *i, tenv.var(call));
break;
case BINARY:
if (call->list_len() != 3)
- throw Error(call->loc, (format("`%1%' requires exactly 2 arguments") % n).str());
+ throw RespError(call->loc, (format("`%1%' requires exactly 2 arguments") % n).str());
c.constrain(tenv, *++i, tenv.var(call));
c.constrain(tenv, *++i, tenv.var(call));
break;
case LOGICAL:
if (call->list_len() != 3)
- throw Error(call->loc, (format("`%1%' requires exactly 2 arguments") % n).str());
+ throw RespError(call->loc, (format("`%1%' requires exactly 2 arguments") % n).str());
c.constrain(tenv, call, tenv.named("Bool"));
c.constrain(tenv, *++i, tenv.named("Bool"));
c.constrain(tenv, *++i, tenv.named("Bool"));
break;
case COMPARISON:
if (call->list_len() != 3)
- throw Error(call->loc, (format("`%1%' requires exactly 2 arguments") % n).str());
+ throw RespError(call->loc, (format("`%1%' requires exactly 2 arguments") % n).str());
var = tenv.var(*++i);
c.constrain(tenv, call, tenv.named("Bool"));
c.constrain(tenv, *++i, var);
break;
default:
- throw Error(call->loc, (format("unknown primitive `%1%'") % n).str());
+ throw RespError(call->loc, (format("unknown primitive `%1%'") % n).str());
}
}
static void
-constrain_list(TEnv& tenv, Constraints& c, const ATuple* tup) throw(Error)
+constrain_list(TEnv& tenv, Constraints& c, const ATuple* tup)
{
const ASymbol* const sym = tup->fst()->to_symbol();
if (!sym) {
@@ -423,7 +423,7 @@ constrain_list(TEnv& tenv, Constraints& c, const ATuple* tup) throw(Error)
}
void
-resp_constrain(TEnv& tenv, Constraints& c, const AST* ast) throw(Error)
+resp_constrain(TEnv& tenv, Constraints& c, const AST* ast)
{
switch (ast->tag()) {
case T_UNKNOWN:
@@ -449,6 +449,6 @@ resp_constrain(TEnv& tenv, Constraints& c, const AST* ast) throw(Error)
constrain_list(tenv, c, ast->as_tuple());
break;
case T_ELLIPSIS:
- throw Error(ast->loc, "ellipsis present after expand stage");
+ throw RespError(ast->loc, "ellipsis present after expand stage");
}
}
diff --git a/src/llvm.cpp b/src/llvm.cpp
index 038beb1..88d937a 100644
--- a/src/llvm.cpp
+++ b/src/llvm.cpp
@@ -23,16 +23,17 @@
#define __STDC_CONSTANT_MACROS 1
#include <map>
+#include <memory>
#include <sstream>
+#include <stack>
#include <string>
#include <vector>
-#include <stack>
#include <boost/format.hpp>
#include "llvm/ExecutionEngine/ExecutionEngine.h"
-#include "llvm/ExecutionEngine/JIT.h"
-#include "llvm/ExecutionEngine/JITMemoryManager.h"
+#include "llvm/ExecutionEngine/MCJIT.h"
+// #include "llvm/ExecutionEngine/JITMemoryManager.h"
#include "llvm/IR/AssemblyAnnotationWriter.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
@@ -42,10 +43,10 @@
#include "llvm/IR/Module.h"
#include "llvm/IR/Value.h"
#include "llvm/IR/Verifier.h"
-#include "llvm/PassManager.h"
+#include "llvm/IR/PassManager.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/raw_os_ostream.h"
-#include "llvm/Transforms/IPO/PassManagerBuilder.h"
+// #include "llvm/Transforms/IPO/PassManagerBuilder.h"
#include "llvm/Transforms/Scalar.h"
#include "resp.hpp"
@@ -58,8 +59,8 @@ struct IfRecord {
IfRecord(LLVMContext& context, unsigned labelIndex, Type* t)
: type(t)
, mergeBB(BasicBlock::Create(context, "endif"))
- , thenBB(BasicBlock::Create(context, (format("then%1%") % labelIndex).str()))
- , elseBB(BasicBlock::Create(context, (format("else%1%") % labelIndex).str()))
+ , thenBB(BasicBlock::Create(context, (boost::format("then%1%") % labelIndex).str()))
+ , elseBB(BasicBlock::Create(context, (boost::format("else%1%") % labelIndex).str()))
, thenV(NULL)
, elseV(NULL)
, nMergeBranches(0)
@@ -119,12 +120,12 @@ private:
Type* llType(const AST* t, const char* name=NULL);
LLVMContext context;
- Module* module;
- ExecutionEngine* engine;
+ std::unique_ptr<Module> module;
+ ExecutionEngine* eengine;
IRBuilder<> builder;
Function* alloc;
FunctionPassManager* fnOpt;
- PassManager* modOpt;
+ ModulePassManager* modOpt;
CType objectT;
StructType* opaqueT;
@@ -148,23 +149,23 @@ LLVMEngine::LLVMEngine()
, labelIndex(1)
{
InitializeNativeTarget();
- module = new Module("resp", context);
- engine = EngineBuilder(module).create();
- fnOpt = new FunctionPassManager(module);
- modOpt = new PassManager();
+ module = llvm::make_unique<Module>("resp", context);
+ fnOpt = new FunctionPassManager(module.get());
+ // engine = EngineBuilder(module).create();
+ modOpt = new ModulePassManager();
// Set up optimisers
- PassManagerBuilder pmb;
- pmb.OptLevel = 3;
- pmb.populateFunctionPassManager(*fnOpt);
- pmb.populateModulePassManager(*modOpt);
+ // PassManagerBuilder pmb;
+ // pmb.OptLevel = 3;
+ // pmb.populateFunctionPassManager(*fnOpt);
+ // pmb.populateModulePassManager(*modOpt);
// Declare host provided allocation primitive
std::vector<Type*> argsT(1, Type::getInt32Ty(context)); // unsigned size
FunctionType* funcT = FunctionType::get(
PointerType::get(Type::getInt8Ty(context), 0), argsT, false);
alloc = Function::Create(
- funcT, Function::ExternalLinkage, "__resp_alloc", module);
+ funcT, Function::ExternalLinkage, "__resp_alloc", module.get());
// Build Object type (tag only, binary compatible with any constructed thing)
vector<Type*> ctypes;
@@ -175,7 +176,7 @@ LLVMEngine::LLVMEngine()
LLVMEngine::~LLVMEngine()
{
- delete engine;
+ delete eengine;
delete fnOpt;
delete modOpt;
}
@@ -313,11 +314,11 @@ CVal
LLVMEngine::compileCons(CEnv& cenv, const char* tname, const ATuple* type, CVal rtti, const vector<CVal>& fields)
{
// Find size of memory required
- size_t s = engine->getDataLayout()->getTypeSizeInBits(
+ size_t s = module->getDataLayout().getTypeSizeInBits(
PointerType::get(Type::getInt8Ty(context), 0));
assert(type->begin() != type->end());
for (ATuple::const_iterator i = type->iter_at(1); i != type->end(); ++i)
- s += engine->getDataLayout()->getTypeSizeInBits(
+ s += module->getDataLayout().getTypeSizeInBits(
(Type*)compileType(cenv, (*i)->str(), *i));
// Allocate struct
@@ -341,7 +342,7 @@ LLVMEngine::compileCons(CEnv& cenv, const char* tname, const ATuple* type, CVal
for (vector<CVal>::const_iterator f = fields.begin(); f != fields.end(); ++f, ++i, ++t) {
Value* val = llVal(*f);
Value* field = builder.CreateStructGEP(
- structPtr, i, (format("tup%1%") % i).str().c_str());
+ structPtr, i, (boost::format("tup%1%") % i).str().c_str());
if ((*t)->to_tuple())
val = builder.CreateBitCast(val, llType(*t), "objPtr");
@@ -370,7 +371,7 @@ LLVMEngine::compileLiteral(CEnv& cenv, const AST* lit)
case T_INT32:
return ConstantInt::get(Type::getInt32Ty(context), ((const ALiteral<int32_t>*)lit)->val, true);
default:
- throw Error(lit->loc, "Unknown literal type");
+ throw RespError(lit->loc, "Unknown literal type");
}
}
@@ -424,12 +425,12 @@ LLVMEngine::compileProt(
}
THROW_IF(!llType(retT), Cursor(),
- (format("return has non-concrete type `%1%'") % retT->str()).str());
+ (boost::format("return has non-concrete type `%1%'") % retT->str()).str());
const string llName = (name == "") ? cenv.penv.gensymstr("_fn") : name;
FunctionType* fT = FunctionType::get(llType(retT), cprot, false);
- Function* f = Function::Create(fT, linkage, llName, module);
+ Function* f = Function::Create(fT, linkage, llName, module.get());
// Note f->getName() may be different from llName
// however LLVM chooses to mangle is fine, we keep a pointer
@@ -483,8 +484,8 @@ LLVMEngine::pushFnArgs(CEnv& cenv, const ATuple* prot, const ATuple* type, CFunc
// Bind argument values in CEnv
ATuple::const_iterator p = prot->begin();
ATuple::const_iterator pT = argsT->begin();
- assert(prot->size() == argsT->size());
- assert(prot->size() == f->num_args());
+ assert(prot->list_len() == argsT->list_len());
+ // assert(prot->list_len() == f->num_args());
for (Function::arg_iterator a = f->arg_begin(); a != f->arg_end(); ++a, ++p, ++pT) {
const AST* t = *pT;//cenv.resolveType(*pT);
// THROW_IF(!llType(t), (*p)->loc, "untyped parameter\n");
@@ -504,11 +505,13 @@ LLVMEngine::finishFn(CEnv& cenv, CVal ret, const AST* retT)
llvm::raw_os_ostream os(std::cerr);
if (verifyFunction(*static_cast<Function*>(f), &os)) {
- module->dump();
- throw Error(Cursor(), "Broken module");
+ // module->dump();
+ throw RespError(Cursor(), "Broken module");
+ }
+ llvm::AnalysisManager<Function> amanager;
+ if (cenv.args.find("-g") == cenv.args.end()) {
+ fnOpt->run(*static_cast<Function*>(f), amanager);
}
- if (cenv.args.find("-g") == cenv.args.end())
- fnOpt->run(*static_cast<Function*>(f));
currentFn = NULL;
}
@@ -644,7 +647,7 @@ LLVMEngine::compilePrimitive(CEnv& cenv, const ATuple* prim)
return engine->builder.CreateICmp(pred, a, b);
}
- throw Error(prim->loc, "unknown primitive");
+ throw RespError(prim->loc, "unknown primitive");
}
CVal
@@ -670,8 +673,10 @@ LLVMEngine::compileGlobalGet(CEnv& cenv, const string& sym, CVal val)
void
LLVMEngine::writeModule(CEnv& cenv, std::ostream& os)
{
- if (cenv.args.find("-g") == cenv.args.end())
- modOpt->run(*module);
+ if (cenv.args.find("-g") == cenv.args.end()) {
+ llvm::AnalysisManager<Module> amanager;
+ modOpt->run(*module, amanager);
+ }
AssemblyAnnotationWriter writer;
llvm::raw_os_ostream raw_stream(os);
@@ -681,7 +686,7 @@ LLVMEngine::writeModule(CEnv& cenv, std::ostream& os)
const string
LLVMEngine::call(CEnv& cenv, CFunc f, const AST* retT)
{
- void* fp = engine->getPointerToFunction(llFunc(f));
+ void* fp = eengine->getPointerToFunction(llFunc(f));
const Type* t = llType(retT);
THROW_IF(!fp, Cursor(), "unable to get function pointer");
THROW_IF(!t, Cursor(), "function with non-concrete return type called");
@@ -701,6 +706,7 @@ LLVMEngine::call(CEnv& cenv, CFunc f, const AST* retT)
case '\"':
case '\\':
ss << '\\';
+ // fallthru
default:
ss << c;
break;
diff --git a/src/parse.cpp b/src/parse.cpp
index ce69a72..bafe8d2 100644
--- a/src/parse.cpp
+++ b/src/parse.cpp
@@ -71,7 +71,7 @@ read_string(Cursor& cur, istream& in)
break;
default:
cin.putback(c);
- throw Error(cur, string("unknown string escape `\\") + (char)c + "'");
+ throw RespError(cur, string("unknown string escape `\\") + (char)c + "'");
}
default:
str.push_back(c);
@@ -124,7 +124,7 @@ read_special(Cursor& cur, istream& in)
eat_char(cur, in, 'f');
return new ALiteral<bool>(T_BOOL, false, cur);
default:
- throw Error(cur, (format("unknown special lexeme `%1%'") % in.peek()).str());
+ throw RespError(cur, (format("unknown special lexeme `%1%'") % in.peek()).str());
}
assert(false);
}
@@ -166,7 +166,7 @@ read_symbol(PEnv& penv, Cursor& cur, istream& in)
/// Read an expression from @a in
const AST*
-PEnv::parse(Cursor& cur, istream& in) throw(Error)
+PEnv::parse(Cursor& cur, istream& in)
{
while (!cin.eof()) {
skip_space(cur, in);
@@ -182,7 +182,7 @@ PEnv::parse(Cursor& cur, istream& in) throw(Error)
case '(':
return read_list(*this, cur, in);
case ')':
- throw Error(cur, "unexpected `)'");
+ throw RespError(cur, "unexpected `)'");
case '#':
{
const AST* ret = read_special(cur, in);
diff --git a/src/repl.cpp b/src/repl.cpp
index d3ad22e..e6de528 100644
--- a/src/repl.cpp
+++ b/src/repl.cpp
@@ -42,7 +42,7 @@ readExpand(PEnv& penv, Cursor& cursor, istream& is, const AST*& exp)
{
try {
exp = penv.parse(cursor, is);
- } catch (Error e) {
+ } catch (RespError e) {
cerr << e.what() << endl;
is.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); // Skip REPL junk
throw e;
@@ -224,7 +224,7 @@ eval(CEnv& cenv, Cursor& cursor, istream& is, bool execute)
callPrintCollect(cenv, cenv.engine()->getFn(cenv, "main"),
ast, retT, execute);
- } catch (Error& e) {
+ } catch (RespError& e) {
cenv.err << e.what() << endl;
return 1;
}
@@ -288,7 +288,7 @@ repl(CEnv& cenv)
ast, retT, true);
}
- } catch (Error& e) {
+ } catch (RespError& e) {
cenv.err << e.what() << endl;
}
}
diff --git a/src/resp.cpp b/src/resp.cpp
index 7167227..d62e0aa 100644
--- a/src/resp.cpp
+++ b/src/resp.cpp
@@ -170,7 +170,7 @@ main(int argc, char** argv)
pprint(os, ast, cenv, false);
is.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); // Skip newlines
}
- } catch (Error e) {
+ } catch (RespError e) {
cerr << e.what() << endl;
}
is.close();
diff --git a/src/resp.hpp b/src/resp.hpp
index 9179b16..892ba13 100644
--- a/src/resp.hpp
+++ b/src/resp.hpp
@@ -38,7 +38,7 @@
#include <boost/format.hpp>
-#define THROW_IF(cond, error, ...) { if (cond) throw Error(error, __VA_ARGS__); }
+#define THROW_IF(cond, error, ...) { if (cond) throw RespError(error, __VA_ARGS__); }
using namespace std;
using boost::format;
@@ -58,8 +58,8 @@ struct Cursor {
};
/// Compilation error
-struct Error {
- Error(Cursor c, const string& m) : loc(c), msg(m) {}
+struct RespError {
+ RespError(Cursor c, const string& m) : loc(c), msg(m) {}
const string what() const { return (loc ? loc.str() + ": " : "") + "error: " + msg; }
const Cursor loc;
const string msg;
@@ -545,7 +545,7 @@ struct PEnv : private map<const string, const char*> {
}
}
- const AST* parse(Cursor& cur, std::istream& in) throw(Error);
+ const AST* parse(Cursor& cur, std::istream& in);
const AST* expand(const AST* exp);
typedef std::set<std::string> Primitives;
@@ -931,7 +931,7 @@ int repl(CEnv& cenv);
const AST* resp_cps(CEnv& cenv, const AST* ast, const AST* k) throw();
-void resp_constrain(TEnv& tenv, Constraints& c, const AST* ast) throw(Error);
+void resp_constrain(TEnv& tenv, Constraints& c, const AST* ast);
typedef const AST* (RespPass)(CEnv& cenv, Code& code, const AST* ast);
diff --git a/src/unify.cpp b/src/unify.cpp
index a23bbcb..79f1a8f 100644
--- a/src/unify.cpp
+++ b/src/unify.cpp
@@ -161,14 +161,14 @@ unify(const Constraints& constraints)
else if (*si && *ti)
cp.push_back(Constraint(*si, *ti));
else
- throw Error(Cursor(), "match with missing list element");
+ throw RespError(Cursor(), "match with missing list element");
}
if ((si == st->end() && ti == tt->end())
|| (si != st->end() && is_dots(*si))
|| (ti != tt->end() && is_dots(*ti)))
return unify(cp);
}
- throw Error(s->loc,
+ throw RespError(s->loc,
(format("type is `%1%' but should be `%2%'\n%3%: error: to match `%4%' here")
% s->str() % t->str() % t->loc.str() % t->str()).str());
}
diff --git a/wscript b/wscript
index 6d950da..dc1e918 100644
--- a/wscript
+++ b/wscript
@@ -43,8 +43,8 @@ def configure(conf):
conf.env.append_unique('CXXFLAGS', '-std=c++11')
conf.check_cfg(
- path = 'llvm-config-3.5',
- args = '--cppflags --ldflags --libs --system-libs core jit native codegen ipo',
+ path = 'llvm-config',
+ args = '--cppflags --ldflags --libs --system-libs core native codegen ipo',
package = '',
uselib_store = 'LLVM')