diff --git a/BitcodeEmitter.cpp b/BitcodeEmitter.cpp index 26c208f..05de25a 100644 --- a/BitcodeEmitter.cpp +++ b/BitcodeEmitter.cpp @@ -587,6 +587,10 @@ bool BitcodeEmitter::emit(Program const& program) { GUARDED(proto.emit(this)); } + for (Function const& function: program.getFunctions()) { + GUARDED(function.getPrototype().emit(this)); + } + for (Function const& function: program.getFunctions()) { GUARDED(function.emit(this)); } diff --git a/ModuleRegistry.cpp b/ModuleRegistry.cpp index c370e89..13444c1 100644 --- a/ModuleRegistry.cpp +++ b/ModuleRegistry.cpp @@ -53,7 +53,7 @@ void ModuleRegistry::registerFunction(FunctionPrototype *proto) { #define PUT(type, funcname) \ new FunctionPrototype { \ new Id {#funcname}, Type::VOID, \ - plist({ \ + plist_of({ \ new FunArg {new Id {"value"}, type, false} \ }), \ } @@ -77,7 +77,7 @@ void monicelli::registerStdLib(ModuleRegistry &r) { r.registerFunction(GET(Type::INT, __Monicelli_getInt)); r.registerFunction(new FunctionPrototype { new Id("__Monicelli_assert"), Type::VOID, - plist({ + plist_of({ new FunArg {new Id("condition"), Type::CHAR, false} }) }); diff --git a/Pointers.hpp b/Pointers.hpp index c4d8159..5667dee 100644 --- a/Pointers.hpp +++ b/Pointers.hpp @@ -33,7 +33,7 @@ template using PointerList = boost::ptr_vector; template using PointerSet = boost::ptr_unordered_set; template -PointerList* plist(std::initializer_list elements) { +PointerList* plist_of(std::initializer_list elements) { PointerList *result = new PointerList(elements.size()); for (T *el: elements) { result->push_back(el);