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

Put essential functionality into LLVM instead of clang #52

Open
shawnl opened this issue Jun 9, 2019 · 5 comments
Open

Put essential functionality into LLVM instead of clang #52

shawnl opened this issue Jun 9, 2019 · 5 comments

Comments

@shawnl
Copy link

shawnl commented Jun 9, 2019

Is it at all possible to put the core functionality (RecordFieldReorganizer.cpp and RecordLayoutBuilder.cpp) into LLVM, instead of clang? This would require putting the C ABI[1] also in LLVM (which is a good thing, as most LLVM front-ends want C ABI compatibility).

I understand that might slow down this project (especially as you are geting close to merging this), but there is a long history of putting generally useful functionality in clang instead of LLVM for expediency, and it leaves other LLVM front-ends in the dark.

I think this has extra importance for this project, in that putting this in clang prevents interoperability with other languages.

[1] for structs. Var arg handling is much more difficult, and not necessary to get this into LLVM. ABI handling can still fall back to clang.

@shawnl shawnl changed the title Consider putting some functionality into LLVM instead of clang Consider putting essential functionality into LLVM instead of clang Jun 9, 2019
@shawnl shawnl changed the title Consider putting essential functionality into LLVM instead of clang Put essential functionality into LLVM instead of clang Jun 9, 2019
@shawnl
Copy link
Author

shawnl commented Jun 9, 2019

OK, from reading only the ARM64 passing conventions, it might be able to get away with this without touching the C ABI.

@connorkuehl
Copy link

@shawnl Thanks for the suggestion! I can't speak for the rest of the team on this but it's certainly an interesting idea. I think it's worth discussing especially since this project requires a fair bit more work anyway before it gets merged.

That said, I can't make this project a priority at the moment, so I don't think it's fair for me to approve / deny anything at this point.

Sorry that this reply is rather useless. I just didn't want you to think you were being ignored.

@shawnl
Copy link
Author

shawnl commented Jul 2, 2019

My point is that most languages these days that intend to be compiled to machine code want compatibility with the C ABI, and randstruct will be part of that (and can be made compatible between languages by sharing the seed). LLVM knows what a struct is.

@shawnl
Copy link
Author

shawnl commented Jul 29, 2019

So there was some valid pushback on this in the Phrabricator issue. So all I really ask is that the implementors of this consider other frontends, and the possibility of sharing randomized structs between differn't front-ends. (passing the key to each front-end)

Maybe it is possible to design rand-struct in such a way that the most important code does not depend on clang or llvm internals. (only the llvm C++ api).

@shawnl
Copy link
Author

shawnl commented Jul 29, 2019

Depends on #47

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

No branches or pull requests

2 participants