Generalize "main" to a settable entry point name.

This commit is contained in:
John Kessenich
2016-03-12 18:17:47 -07:00
parent 6cc7674b6d
commit 4d65ee31a6
8 changed files with 38 additions and 8 deletions

View File

@@ -893,7 +893,7 @@ void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decorat
}
// Comments in header
Function* Builder::makeMain()
Function* Builder::makeEntrypoint(const char* entryPoint)
{
assert(! mainFunction);
@@ -901,7 +901,7 @@ Function* Builder::makeMain()
std::vector<Id> params;
std::vector<Decoration> precisions;
mainFunction = makeFunctionEntry(NoPrecision, makeVoidType(), "main", params, precisions, &entry);
mainFunction = makeFunctionEntry(NoPrecision, makeVoidType(), entryPoint, params, precisions, &entry);
return mainFunction;
}