Skip to content

Add support for LLVM 19 and 20 (not CI tested) #13

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

Open
wants to merge 4 commits into
base: devel
Choose a base branch
from

Conversation

sebastiankreutzer
Copy link
Member

This patch adds support the newest version of LLVM. This is not tested in the CI yet and versions 19 and 20 are therefore not marked as supported.
Instead of giving an error, CMake now only prints a warning, if an unsupported version is detected.

@sebastiankreutzer
Copy link
Member Author

Interesting, my local GCC and Clang builds where happy. Good thing we have the CI!

@sebastiankreutzer
Copy link
Member Author

The last fixups re-add the template specifier where it's definitely needed (at least for older GCC versions), i.e. in front of function template invocations with dependent parameters. Took a few tries, but this should work for all versions now.

Copy link
Contributor

@TimHeldmann TimHeldmann left a comment

Choose a reason for hiding this comment

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

Looks good to me.
It is a bit unlucky we have to resort to more and more version specific code.
But I think it is still to little to be a problem.

Comment on lines +243 to +248
const auto& [has, data] = node->template checkAndGet<PiraOneData>();
if (has) {
data->setNumberOfStatements(numStmts);
data->setHasBody(hasBody);
data->setDominantRuntime(dominantRuntime);
data->setComesFromCube(inPrevProfile);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a formatting error or correction?

Comment on lines +39 to +40
MCGLogger::instance().getErrConsole()->warn("Could not create: {}, the Metadata is unknown in you application",
s);
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer to have the error in one single line, instead of having only the formatting parameter in a new line.

Suggested change
MCGLogger::instance().getErrConsole()->warn("Could not create: {}, the Metadata is unknown in you application",
s);
MCGLogger::instance().getErrConsole()->warn(
"Could not create: {}, the Metadata is unknown in you application", s);

@jplehr
Copy link
Member

jplehr commented Apr 4, 2025

Looks good to me.

It is a bit unlucky we have to resort to more and more version specific code.

But I think it is still to little to be a problem.

Agreed! Also, that's what you need to do when you do not have a stable API. And I still prefer this over using the (more stable) C interface.

If this increases more substantially, we should reflect on whether we care enough and if we want to add a wrapper layer.

Copy link
Member

@jplehr jplehr left a comment

Choose a reason for hiding this comment

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

Please run a git-clang-format again

@@ -106,7 +106,7 @@ class CgNode {
}

auto nmd = new T(args...);
this->template addMetaData(nmd);
Copy link
Member

Choose a reason for hiding this comment

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

I would think this is a change that is not related to the ability to use newer llvm versions. Am I missing something?
Will this break some GCC compatibility with older versions or so?

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.

3 participants