Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix getOrInsertFunction syntax error for latest LLVM #14

Merged
merged 2 commits into from
Sep 10, 2017

Conversation

evilpan
Copy link

@evilpan evilpan commented Sep 9, 2017

A simple fix for issue #13

Copy link
Owner

@sampsyo sampsyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great; thank you! I have a couple of style suggestions inline.

);
std::vector<Type*> paramsType = {Type::getInt32Ty(Ctx)};
Type *retType = Type::getVoidTy(Ctx);
FunctionType *logFuncType = FunctionType::get(retType,paramsType,false);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please use spaces between the commas in function calls?

Constant *logFunc = F.getParent()->getOrInsertFunction(
"logop", Type::getVoidTy(Ctx), Type::getInt32Ty(Ctx), NULL
);
std::vector<Type*> paramsType = {Type::getInt32Ty(Ctx)};
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A better name here is probably paramTypes, since there are multiple types. (The current name implies that it’s a single type.)

@sampsyo
Copy link
Owner

sampsyo commented Sep 9, 2017

With this change, does everything seem to work with the latest LLVM? (Including the linker error from #12?) If so, we should probably update the README.

@evilpan
Copy link
Author

evilpan commented Sep 9, 2017 via email

@sampsyo
Copy link
Owner

sampsyo commented Sep 10, 2017

Awesome; thank you!

@sampsyo sampsyo merged commit 806bc1e into sampsyo:rtlib Sep 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants