Skip to content

Commit

Permalink
Revert "[metacling] Add cache when computing the TClingTypeInfo::Name"
Browse files Browse the repository at this point in the history
Try if that fixes the bot failures.
  • Loading branch information
vgvassilev committed Apr 2, 2019
1 parent c35c7b0 commit 72d9c68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
9 changes: 5 additions & 4 deletions core/metacling/src/TClingTypeInfo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,13 @@ const char *TClingTypeInfo::Name() const
if (!IsValid()) {
return "";
}
if (!fNameCache.empty())
return fNameCache.c_str();
// Note: This *must* be static because we are returning a pointer inside it!
TTHREAD_TLS_DECL( std::string, buf);
buf.clear();

R__LOCKGUARD(gInterpreterMutex);
ROOT::TMetaUtils::GetFullyQualifiedTypeName(fNameCache, fQualType, *fInterp);
return fNameCache.c_str();
ROOT::TMetaUtils::GetFullyQualifiedTypeName(buf,fQualType,*fInterp);
return buf.c_str();
}

////////////////////////////////////////////////////////////////////////////////
Expand Down
11 changes: 0 additions & 11 deletions core/metacling/src/TClingTypeInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@

#include "clang/AST/Type.h"

#include <string>

namespace cling {
class Interpreter;
}
Expand All @@ -44,8 +42,6 @@ class TClingTypeInfo {
private:
cling::Interpreter *fInterp; //Cling interpreter, we do *not* own.
clang::QualType fQualType; //Clang qualified type we are querying.
// FIXME: Factor out in the TClingGenericInfo or a similar concept.
mutable std::string fNameCache;

public:

Expand All @@ -57,13 +53,6 @@ class TClingTypeInfo {

TClingTypeInfo(cling::Interpreter *interp, const char *name);

TClingTypeInfo(TClingTypeInfo& rhs)
{
fInterp = rhs.fInterp;
fQualType = rhs.fQualType;
fNameCache = ""; // we must not copy the cache.
}

cling::Interpreter *GetInterpreter() const { return fInterp; }

clang::QualType GetQualType() const { return fQualType; }
Expand Down

0 comments on commit 72d9c68

Please sign in to comment.