Conversation
…tadata and global metadata
5e4783f to
781bd01
Compare
pearzt
left a comment
There was a problem hiding this comment.
I only did a rough sweep over your changes, but everything looks sensible to me.
| abort(); | ||
| } | ||
| assert(false && "This metadata can not be exported and therefore is not mergeable"); | ||
| // const ASTNodeMetadata* toMergeDerived = static_cast<const ASTNodeMetadata*>(&toMerge); |
There was a problem hiding this comment.
nitpick: This looks like a leftover.
jplehr
left a comment
There was a problem hiding this comment.
I think this is basically two changes smushed into one PR together with more formatting NFC changes.
I would appreciate better separation in the future and left some comments.
| #include "metacg/Callgraph.h" | ||
| #include "metacg/LoggerUtil.h" |
There was a problem hiding this comment.
Unrelated NFC change?
(we can keep it in, but I think it is unrelated)
There was a problem hiding this comment.
Yes this is unrelated and should have probably be part of: #136.
I agree to keep it.
| abort(); | ||
| } | ||
| assert(false && "This metadata can not be exported and therefore is not mergeable"); | ||
| // const ASTNodeMetadata* toMergeDerived = static_cast<const ASTNodeMetadata*>(&toMerge); |
| } | ||
|
|
||
| /** | ||
| * Specify how to clone your metadat |
There was a problem hiding this comment.
| * Specify how to clone your metadat | |
| * Specify how to clone your metadata |
| * https://github.com/tudasc/metacg/LICENSE.txt | ||
| */ | ||
| #include "../interface/CaGePlugin.h" | ||
| #include "cage/interface/CaGePlugin.h" |
| * | ||
| * @param g A map how to rename the old node-id to a new node-id, which is valid in the merged graph | ||
| */ | ||
| void applyMapping(const metacg::GraphMapping& g) final {} |
There was a problem hiding this comment.
Mark g as [[maybe_unused]] or remove it?
There was a problem hiding this comment.
You can not add param documentation to an unnamed parameter.
I therefore will mark it as [[maybe_unused]].
| } | ||
|
|
||
| /** | ||
| * Specify how to clone your metadat |
There was a problem hiding this comment.
| * Specify how to clone your metadat | |
| * Specify how to clone your metadata |
| /** | ||
| * Returns mangled names for all named decls, including Ctor/Dtor. | ||
| */ | ||
| static std::vector<std::string> getMangledName(clang::NamedDecl const* const nd) { |
There was a problem hiding this comment.
Is this the same logic that we use in the old cgcollector? I assume that there is no easy way to share code between such components, right?
If we wanted to do that we would require another shared lib that provides such things.
There was a problem hiding this comment.
Yes this is the same logic used in cgc1.
There is currently no way (except linking the cgc2 against the cgc1's lib), to share this logic.
I am initially against having cgc1 and cgc2 share parts of their code in a shared library.
But I am open to reasons and to discuss if there is a need for smth. like a "ASTUtilitys.so", but this should be a different PR.
There was a problem hiding this comment.
Oh yeah, this is a matter of understanding the situation. Certainly for future PR.
|
|
||
| #include "metacg/metadata/MetaData.h" | ||
| #include <SharedDefs.h> | ||
| #include <cgcollector2/SharedDefs.h> |
There was a problem hiding this comment.
| #include <cgcollector2/SharedDefs.h> | |
| #include "cgcollector2/SharedDefs.h" |
| mightCall.reserve(mightCall.size()+toMergeDerived->mightCall.size()); | ||
| for(const auto& elem : toMergeDerived->mightCall){ | ||
| if(std::find(mightCall.begin(), mightCall.end(), elem)!=mightCall.end()){ | ||
| // This might be faster when using |
There was a problem hiding this comment.
I think all of this is unrelated formatting NFC only, right?
There was a problem hiding this comment.
yes, looks like it.
I think I can take this whole file out of the PR.
It probably got included during reformatting.
The above change is also NFC.
| metacg::MCGLogger::instance().getErrConsole()->error("cannot locate the library at {}!", pluginPath); | ||
| metacg::MCGLogger::instance().getErrConsole()->error("Reason: {}", err); |
There was a problem hiding this comment.
Should we first construct a single string and then pass that to the error function to avoid splitting the info in log files when multiple processes run?
This PR adds two Demoplugins, one for CaGe and one for CGC2.
They are also added to the CI, to test whether we can correctly link and run plugins in CaGe and CGC2.
To add the Demoplugins the PR adds an interface library to link against, as well as changin the CMake files to install the necessary header files.
It lastly moved the existing FileInfoMetadata+Collector combo, which served as a demo plugin for CGC2 to the graphlib core-metadata.
This is because legacy CGC outputs FileInfoMD by default.
Looking forward to your feedback.