Add support for LLVM 19 and 20 (not CI tested)#13
Conversation
|
Interesting, my local GCC and Clang builds where happy. Good thing we have the CI! |
|
The last fixups re-add the |
TimHeldmann
left a comment
There was a problem hiding this comment.
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.
| const auto& [has, data] = node->template checkAndGet<PiraOneData>(); | ||
| if (has) { | ||
| data->setNumberOfStatements(numStmts); | ||
| data->setHasBody(hasBody); | ||
| data->setDominantRuntime(dominantRuntime); | ||
| data->setComesFromCube(inPrevProfile); |
There was a problem hiding this comment.
Is this a formatting error or correction?
There was a problem hiding this comment.
This is a correction. I touched the file at some point so it was auto-formatted.
I think I reverted that particular change, so the content is the same.
I would just leave this bit of formatting in because I think clang-format will complain otherwise.
Does this sound ok?
| MCGLogger::instance().getErrConsole()->warn("Could not create: {}, the Metadata is unknown in you application", | ||
| s); |
There was a problem hiding this comment.
I would prefer to have the error in one single line, instead of having only the formatting parameter in a new line.
| 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); |
There was a problem hiding this comment.
I'm inclined to agree. Unfortunately clang-format does not and automatically changes it back to the original version 😄
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. |
jplehr
left a comment
There was a problem hiding this comment.
Please run a git-clang-format again
| } | ||
|
|
||
| auto nmd = new T(args...); | ||
| this->template addMetaData(nmd); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Yes, it is related. Using the template keyword results in the following:
/home/sebastian/git/MetaCG-Gitlab/graph/include/CgNode.h:109:20: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
109 | this->template addMetaData(nmd);
This works in previous LLVM and GCC versions, but is not standard compliant. Since LLVM 19 (?) this is handled more strictly and results in the error shown above.
There was a problem hiding this comment.
So this is enabling the compilation with Clang 19 and beyond?
Don't want to block it, just trying to understand as I always thought that this is about getting the API calls right, not something else.
There was a problem hiding this comment.
It's both - enabling the CGCollector to work with Clang 19+ and compiling the project as a whole with thise Clang versions.
There was a problem hiding this comment.
How is this particular change with the template keyword related to enable CGCollector to work with Clang 19+? That's the bit that I do not understand.
I can see how this enables to compile CGCollector with Clang 19+, but not how this impacts to use Clang19+ as a library.
c99c1b3 to
df8d09d
Compare
df8d09d to
709ec3a
Compare
|
I think I addressed all the feedback and re-formatted the sources. Could you have another look, @jplehr and @TimHeldmann ? |
jplehr
left a comment
There was a problem hiding this comment.
Some nits. I'll leave it with @TimHeldmann to accept.
| const auto fileEntry = fullSrcLoc.getFileEntry(); | ||
| if (!fileEntry) { | ||
| return result; | ||
| std::string fileNameStr = ""; |
There was a problem hiding this comment.
I think this can remain at the original position.
| const auto& [has, data] = node->template checkAndGet<PiraOneData>(); | ||
| if (has) { | ||
| data->setNumberOfStatements(numStmts); | ||
| data->setHasBody(hasBody); | ||
| data->setDominantRuntime(dominantRuntime); | ||
| data->setComesFromCube(inPrevProfile); |
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.