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

Detect duplicates in rootmaps.(ROOT-6055). #60

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion core/meta/src/TCling.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3646,6 +3646,7 @@ int TCling::ReadRootmapFile(const char *rootmapfile)
TString lib_name = "";
std::string line;
while (getline(file, line, '\n')) {
if (fSeenForwdDecl.find(line) != fSeenForwdDecl.end()) continue;
if ((line.substr(0, 8) == "Library.") ||
(line.substr(0, 8) == "Declare.")) {
file.close();
Expand Down Expand Up @@ -3700,10 +3701,13 @@ int TCling::ReadRootmapFile(const char *rootmapfile)
if (gDebug > 6)
Info("ReadRootmapFile", "class %s in %s", keyname.c_str(), lib_name.Data());
bool isThere = fMapfile->Lookup(keyname.c_str());
if (!isThere){
if (isThere){
Warning("ReadRootmapFile", "class %s is already in %s", keyname.c_str(), lib_name.Data());
} else {
fMapfile->SetValue(keyname.c_str(), lib_name.Data());
}
}
fSeenForwdDecl.insert(line);
}
file.close();
}
Expand Down
2 changes: 2 additions & 0 deletions core/meta/src/TCling.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#endif

#include <set>
#include <unordered_set>
#include <typeinfo>
#include <map>
#include <vector>
Expand Down Expand Up @@ -125,6 +126,7 @@ class TCling : public TInterpreter {
std::vector<std::pair<TClass*,VoidFuncPtr_t> > fClassesToUpdate;
void* fAutoLoadCallBack;
ULong64_t fTransactionCount; // Cling counter for commited or unloaded transactions which changed the AST.
std::unordered_set<std::string> fSeenForwdDecl;

DeclId_t GetDeclId(const llvm::GlobalValue *gv) const;

Expand Down