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

Support llvm 17.0.0 #1041

Merged
merged 3 commits into from
Nov 5, 2023
Merged

Support llvm 17.0.0 #1041

merged 3 commits into from
Nov 5, 2023

Conversation

thedataking
Copy link
Contributor

@thedataking thedataking commented Nov 3, 2023

This adds support for llvm/clang 17.0.0, as well as just enough support for ARM SVE types so that things don't crash on Apple Silicon.

Also adds extremely limited support for ARMs scalable vector
extension types such that Apple Silicon macs can run unit tests..
@kkysen kkysen changed the title Feature/llvm 17.0.0 Support llvm 17.0.0 Nov 4, 2023
Comment on lines +100 to +106
#else
#include <optional>
std::optional<APSInt> getIntegerConstantExpr(const Expr &E,
const ASTContext &Ctx) {
return E.getIntegerConstantExpr(Ctx);
}
#endif // CLANG_VERSION_MAJOR
Copy link
Contributor

Choose a reason for hiding this comment

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

Does std::optional exist before this? Maybe it's better to keep this function signature always the same and do any conversions inside the function. That way we won't run into any issues at call sites where we use some API that's on std::optional but not llvm::Optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My understanding is that LLVM's Optional type got deprecated with the switch to C++ 17 (source). Therefore, the intent is to not use Optional if we're on LLVM 17 or later; that's why the function signature is intentionally changing.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, did LLVM just change to using C++ 17 for itself?

Copy link
Contributor

@kkysen kkysen left a comment

Choose a reason for hiding this comment

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

I made a suggestion about std::optional if you think that's worth changing. Otherwise it all looks good. I also added a PR description to auto-link the issue.

@thedataking thedataking merged commit 91f539b into master Nov 5, 2023
9 checks passed
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.

Darwin build is broken with LLVM 17
2 participants