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

Issue7955 type first spec 2 #208

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
6d19058
[ntuple] remove small clusters write option
jblomer Aug 30, 2024
657773f
[df] Allow reading std::array branches from TTree
vepadulano Aug 3, 2024
d110ff6
[ci] Disable the win x86 dbg platform
dpiparo Sep 2, 2024
26f20db
[doxygen] use jsroot v7 modules for embeding
linev Jul 12, 2024
ca9aa3e
[ntuple] prepare to make RColumnElement private
silverweed Aug 23, 2024
0a53441
[ntuple] split RColumnElement defs into a separate private header
silverweed Aug 23, 2024
5b62c7e
[ntuple] some cleanups in RColumnElement
silverweed Sep 2, 2024
90d057e
[minuit] use std::string instead of vector<char>
linev Sep 2, 2024
ba1cf53
[minuit] simplify loop over points
linev Sep 2, 2024
dc6ced7
fix copying and cloning of HypoTestResult
will-cern Sep 2, 2024
99d92be
[core] Do not provide source string length to strncpy
linev Sep 2, 2024
fb1ddc8
[gui] fix calloc usage in TGFileItem
linev Sep 2, 2024
6214a86
[rdf] fix gcc14 warning in InterfaceUtils #16360
linev Sep 2, 2024
50088e5
[RF] Remove RooRealMPFE from public interface
guitargeek Aug 30, 2024
fe59efb
[RF] Rename and improve RooStatsUtils::MakeCleanWorkspace
guitargeek Aug 30, 2024
3f9d22a
[doxygen] use relative position for JSROOT drawings
linev Sep 3, 2024
8b9947e
[ntuple] add RNTupleDescriptorBuilder::BuildStreamerInfos()
jblomer Jun 14, 2024
c2cd687
[ntuple] Add RNTupleFileWriter::UpdateStreamerInfos()
jblomer Jun 17, 2024
9fa2309
[ntuple] remove hand-coded streamer info from mini file
jblomer Jun 17, 2024
74c0837
[ntuple] store streamer info records in ROOT file
jblomer Jun 17, 2024
f97315e
[ntuple] add test for streamer info in ROOT file
jblomer Jun 17, 2024
543b738
[ntuple] store read rules in streamer info
jblomer Jun 18, 2024
dc5513b
[ntuple] minor improvements to read rules test
jblomer Jun 18, 2024
005ed6e
[ntuple] work around ROOT bug #15877
jblomer Jun 18, 2024
09c29c0
[ntuple] refine streamer info test
jblomer Jun 18, 2024
e7cfd6c
[ntuple] fix streamer list cleanup in RNTupleFileWriter
jblomer Jul 3, 2024
e868480
[ntuple] fix compilation on some MSVC versions
jblomer Jul 4, 2024
7d6d858
[ntuple] more uniform RFieldDescriptor::IsCustomClass()
jblomer Jul 22, 2024
bebc65d
[ntuple] test BuildStreamerInfos() for [unordered_]map
jblomer Jul 22, 2024
1bf2e55
[ntuple] improve BuildStreamerInfos() testing
jblomer Jul 22, 2024
23ce70a
[ntuple] improve mini file streamer info test
jblomer Jul 22, 2024
719ca8f
[ntuple] minor simplification in WriteTFileStreamerInfo()
jblomer Jul 22, 2024
6dcae9e
[ntuple] minor simplification in mini file
jblomer Jul 22, 2024
84e665e
[ntuple] don't store read rules in TFile
jblomer Jul 23, 2024
171484d
[ntuple] fix-up BuildStreamerInfos() test
jblomer Jul 23, 2024
b9a41e5
[ntuple] fix dictionaries for descriptor tests
jblomer Jul 24, 2024
f7aab70
[ntuple] remove unused ChecksumRNTupleClass()
jblomer Sep 3, 2024
b99c4db
[dictgen] Remove stray inline, fix indent (NFC).
Axel-Naumann Apr 30, 2021
620199a
[cling] CreateNestedNameSpecifierForScopeOf needs specialization cont…
Axel-Naumann May 6, 2021
f97d39e
[cling] Add basic test for names of non-dependent type members.
Axel-Naumann May 7, 2021
8c5b23f
[metacling] Pass specialization context to determine member type name.
Axel-Naumann May 7, 2021
b94084b
[metacling] Test issue #7955.
Axel-Naumann May 7, 2021
69177a0
[metacling] Make TClingMethodInfo::NormalizedName() a proper interface.
Axel-Naumann May 11, 2021
a7f3d57
[metacling] Refactor to reduce var scope, nesting.
Axel-Naumann May 12, 2021
4862b20
[metacling] Handle `A<X>::type A<X>::B<Y>::mem`.
Axel-Naumann May 12, 2021
aa21d16
[cling] add regression test for issue #7955
silverweed Aug 16, 2024
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
4 changes: 4 additions & 0 deletions .github/workflows/root-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ jobs:
config: Debug
- event_name: push
config: Debug
# This is this platform is subject to timeouts when building from
# scratch.
- target_arch: x86
config: Debug

name: Windows 10 ${{ matrix.target_arch }} ${{ matrix.config }}

Expand Down
6 changes: 4 additions & 2 deletions core/clingutils/res/TClingUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -613,12 +613,14 @@ static inline std::string DemangleNameForDlsym(const std::string& name)
//______________________________________________________________________________
// Return the type with all parts fully qualified (most typedefs),
// including template arguments, appended to name.
void GetFullyQualifiedTypeName(std::string &name, const clang::QualType &type, const cling::Interpreter &interpreter);
void GetFullyQualifiedTypeName(std::string &name, const clang::QualType &type, const cling::Interpreter &interpreter,
const clang::ClassTemplateSpecializationDecl *Spec = nullptr);

//______________________________________________________________________________
// Return the type with all parts fully qualified (most typedefs),
// including template arguments, appended to name, without using the interpreter
void GetFullyQualifiedTypeName(std::string &name, const clang::QualType &type, const clang::ASTContext &);
void GetFullyQualifiedTypeName(std::string &name, const clang::QualType &type, const clang::ASTContext &,
const clang::ClassTemplateSpecializationDecl *Spec = nullptr);

//______________________________________________________________________________
// Return the type normalized for ROOT,
Expand Down
17 changes: 11 additions & 6 deletions core/clingutils/src/TClingUtils.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,8 @@ bool ROOT::TMetaUtils::HasCustomConvStreamerMemberFunction(const AnnotatedRecord

void ROOT::TMetaUtils::GetQualifiedName(std::string &qual_name, const clang::QualType &type, const clang::NamedDecl &forcontext)
{
ROOT::TMetaUtils::GetFullyQualifiedTypeName(qual_name, type, forcontext.getASTContext());
ROOT::TMetaUtils::GetFullyQualifiedTypeName(qual_name, type, forcontext.getASTContext(),
llvm::dyn_cast_or_null<clang::ClassTemplateSpecializationDecl>(&forcontext));
}

//----
Expand Down Expand Up @@ -1473,6 +1474,7 @@ static void CreateNameTypeMap(const clang::CXXRecordDecl &cl, ROOT::MembersTypeM
std::string typenameStr;

const clang::ASTContext& astContext = cl.getASTContext();
auto CTSD = llvm::dyn_cast<clang::ClassTemplateSpecializationDecl>(&cl);

// Loop over the non static data member.
for(clang::RecordDecl::field_iterator field_iter = cl.field_begin(), end = cl.field_end();
Expand All @@ -1497,7 +1499,7 @@ static void CreateNameTypeMap(const clang::CXXRecordDecl &cl, ROOT::MembersTypeM
}
}

ROOT::TMetaUtils::GetFullyQualifiedTypeName(typenameStr, fieldType, astContext);
ROOT::TMetaUtils::GetFullyQualifiedTypeName(typenameStr, fieldType, astContext, CTSD);
nameType[field_iter->getName().str()] = ROOT::Internal::TSchemaType(typenameStr.c_str(),dims.str().c_str());
}

Expand Down Expand Up @@ -3489,9 +3491,10 @@ std::string ROOT::TMetaUtils::GetFileName(const clang::Decl& decl,

void ROOT::TMetaUtils::GetFullyQualifiedTypeName(std::string &typenamestr,
const clang::QualType &qtype,
const clang::ASTContext &astContext)
const clang::ASTContext &astContext,
const clang::ClassTemplateSpecializationDecl *Spec /*= nullptr*/)
{
std::string fqname = cling::utils::TypeName::GetFullyQualifiedName(qtype, astContext);
std::string fqname = cling::utils::TypeName::GetFullyQualifiedName(qtype, astContext, Spec);
TClassEdit::TSplitType splitname(fqname.c_str(),
(TClassEdit::EModType)(TClassEdit::kLong64 | TClassEdit::kDropStd | TClassEdit::kDropStlDefault | TClassEdit::kKeepOuterConst));
splitname.ShortType(typenamestr,TClassEdit::kDropStd | TClassEdit::kDropStlDefault | TClassEdit::kKeepOuterConst);
Expand All @@ -3501,7 +3504,8 @@ void ROOT::TMetaUtils::GetFullyQualifiedTypeName(std::string &typenamestr,

void ROOT::TMetaUtils::GetFullyQualifiedTypeName(std::string &typenamestr,
const clang::QualType &qtype,
const cling::Interpreter &interpreter)
const cling::Interpreter &interpreter,
const clang::ClassTemplateSpecializationDecl *Spec /*= nullptr*/)
{
// We need this because GetFullyQualifiedTypeName is triggering deserialization
// This calling the same name function GetFullyQualifiedTypeName, but this should stay here because
Expand All @@ -3510,7 +3514,8 @@ void ROOT::TMetaUtils::GetFullyQualifiedTypeName(std::string &typenamestr,

GetFullyQualifiedTypeName(typenamestr,
qtype,
interpreter.getCI()->getASTContext());
interpreter.getCI()->getASTContext(),
Spec);
}

////////////////////////////////////////////////////////////////////////////////
Expand Down
27 changes: 9 additions & 18 deletions core/dictgen/res/DictSelectionReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,25 +260,16 @@ class DictSelectionReader : public clang::RecursiveASTVisitor<DictSelectionReade
std::unordered_set<std::string> fUnsplittableMembers {};
};

inline bool
InSelectionNamespace(const clang::RecordDecl &,
const std::string &str =
""); ///< Check if in the ROOT::Meta::Selection namespace
inline bool FirstPass(const clang::RecordDecl &); ///< First pass on the AST
inline bool SecondPass(const clang::RecordDecl &); ///< Second pass on the AST, using the information of the first one
inline void
ManageFields(const clang::RecordDecl &,
const std::string &,
ClassSelectionRule &,
bool); ///< Take care of the class fields
inline void
ManageBaseClasses(const clang::CXXRecordDecl &, const std::string &, bool &); ///< Take care of the class bases
bool InSelectionNamespace(const clang::RecordDecl &,
const std::string &str = ""); ///< Check if in the ROOT::Meta::Selection namespace
bool FirstPass(const clang::RecordDecl &); ///< First pass on the AST
bool SecondPass(const clang::RecordDecl &); ///< Second pass on the AST, using the information of the first one
void ManageFields(const clang::RecordDecl &, const std::string &,
ClassSelectionRule &, bool); ///< Take care of the class fields
void ManageBaseClasses(const clang::CXXRecordDecl &, const std::string &, bool &); ///< Take care of the class bases
template <class T>
inline unsigned int ExtractTemplateArgValue(
const T &,
const std::string &); ///< Extract the value of the template parameter
inline const clang::TemplateArgumentList *GetTmplArgList(
const clang::CXXRecordDecl &); ///< Get the template arguments list if any
unsigned int ExtractTemplateArgValue(const T &, const std::string &); ///< Extract the value of the template parameter
const clang::TemplateArgumentList *GetTmplArgList(const clang::CXXRecordDecl &); ///< Get the template arguments list if any

std::string PatternifyName(const std::string &className); ///< Transform instance name in pattern for selection
void GetPointeeType(std::string &typeName); ///< Get name of the pointee type
Expand Down
15 changes: 15 additions & 0 deletions core/dictgen/src/DictSelectionReader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -383,12 +383,27 @@ bool DictSelectionReader::SecondPass(const clang::RecordDecl &recordDecl)

bool DictSelectionReader::VisitRecordDecl(clang::RecordDecl *recordDecl)
{
if (auto CXXRD = llvm::dyn_cast<clang::CXXRecordDecl>(recordDecl)) {
if (CXXRD->getDescribedClassTemplate()) {
// this is a member of a template; ignore: dictionaries can only
// select instances / specializations.
return true;
}
}
if (auto CXXRD = llvm::dyn_cast<clang::CXXRecordDecl>(recordDecl->getDeclContext())) {
if (CXXRD->getDescribedClassTemplate()) {
// this is a member of a template; ignore: dictionaries can only
// select instances / specializations.
return true;
}
}
if (fIsFirstPass)
return FirstPass(*recordDecl);
else
return SecondPass(*recordDecl);
}


////////////////////////////////////////////////////////////////////////////////

/**
Expand Down
2 changes: 1 addition & 1 deletion core/meta/src/TClass.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ void TDumpMembers::Inspect(TClass *cl, const char *pname, const char *mname, con
}
}
if (isPrintable) {
strncpy(line + kvalue, *ppointer, std::min( i, kline - kvalue));
strncpy(line + kvalue, *ppointer, kline - kvalue);
line[kvalue+i] = 0;
} else {
line[kvalue] = 0;
Expand Down
4 changes: 3 additions & 1 deletion core/metacling/src/TClingDataMemberInfo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ from the Clang C++ compiler, not CINT.
#include "clang/AST/Attr.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/GlobalDecl.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
Expand Down Expand Up @@ -586,7 +587,8 @@ const char *TClingDataMemberInfo::TypeName() const
// if (we_need_to_do_the_subst_because_the_class_is_a_template_instance_of_double32_t)
vdType = ROOT::TMetaUtils::ReSubstTemplateArg(vdType, GetClassAsType() );

ROOT::TMetaUtils::GetFullyQualifiedTypeName(buf, vdType, *fInterp);
auto CTSD = llvm::dyn_cast<clang::ClassTemplateSpecializationDecl>(vd->getDeclContext());
ROOT::TMetaUtils::GetFullyQualifiedTypeName(buf, vdType, *fInterp, CTSD);

return buf.c_str();
}
Expand Down
7 changes: 6 additions & 1 deletion core/metacling/src/TClingMethodArgInfo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ the Clang C++ compiler, not CINT.
#include "cling/Interpreter/Interpreter.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/PrettyPrinter.h"
Expand Down Expand Up @@ -148,6 +149,10 @@ const char *TClingMethodArgInfo::TypeName() const
if (!IsValid()) {
return nullptr;
}
return Type()->Name();

const clang::ClassTemplateSpecializationDecl *spec = nullptr;
if (const auto FD = llvm::cast_or_null<clang::FunctionDecl>(TClingDeclInfo::GetDecl()))
spec = llvm::dyn_cast<clang::ClassTemplateSpecializationDecl>(FD->getDeclContext());
return Type()->Name(spec);
}

14 changes: 12 additions & 2 deletions core/metacling/src/TClingMethodInfo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,9 @@ const char *TClingMethodInfo::GetPrototype()
if (const clang::TypeDecl *td = llvm::dyn_cast<clang::TypeDecl>(GetDecl()->getDeclContext())) {
std::string name;
clang::QualType qualType(td->getTypeForDecl(),0);
ROOT::TMetaUtils::GetFullyQualifiedTypeName(name,qualType,*fInterp);
const clang::ClassTemplateSpecializationDecl *spec
= llvm::dyn_cast<clang::ClassTemplateSpecializationDecl>(td);
ROOT::TMetaUtils::GetFullyQualifiedTypeName(name, qualType, *fInterp, spec);
buf += name;
buf += "::";
} else if (const clang::NamedDecl *nd = llvm::dyn_cast<clang::NamedDecl>(FD->getDeclContext())) {
Expand Down Expand Up @@ -688,9 +690,17 @@ const char *TClingMethodInfo::TypeName() const
// The next *two* calls lock the interpreter mutex. Lock here first instead
// of locking/unlocking twice.
R__LOCKGUARD(gInterpreterMutex);
return Type()->Name();
const clang::ClassTemplateSpecializationDecl *spec
= llvm::dyn_cast<clang::ClassTemplateSpecializationDecl>(GetDecl()->getDeclContext());
return Type()->Name(spec);
}

std::string TClingMethodInfo::NormalizedName(ROOT::TMetaUtils::TNormalizedCtxt &ctx) const
{
return Type()->NormalizedName(ctx);
}


const char *TClingMethodInfo::Title()
{
if (!IsValid()) {
Expand Down
1 change: 1 addition & 0 deletions core/metacling/src/TClingMethodInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ class TClingMethodInfo final : public TClingDeclInfo {
const char *GetPrototype();
const char *Name() const override;
const char *TypeName() const;
std::string NormalizedName(ROOT::TMetaUtils::TNormalizedCtxt &ctx) const;
const char *Title();
};

Expand Down
5 changes: 3 additions & 2 deletions core/metacling/src/TClingTypeInfo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ but the type metadata comes from the Clang C++ compiler, not CINT.

#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/Type.h"
#include "clang/AST/PrettyPrinter.h"
#include "clang/Frontend/CompilerInstance.h"
Expand Down Expand Up @@ -97,7 +98,7 @@ void TClingTypeInfo::Init(const char *name)

////////////////////////////////////////////////////////////////////////////////

const char *TClingTypeInfo::Name() const
const char *TClingTypeInfo::Name(const clang::ClassTemplateSpecializationDecl *spec) const
{
if (!IsValid()) {
return "";
Expand All @@ -109,7 +110,7 @@ const char *TClingTypeInfo::Name() const
// TODO: This needs to be locked, but the lock cannot be placed in TClingUtils.cxx as it cannot depend from
// TInterpreter.h for the declaration of gInterpreterMutex. Or can it?
R__LOCKGUARD(gInterpreterMutex);
ROOT::TMetaUtils::GetFullyQualifiedTypeName(buf,fQualType,*fInterp);
ROOT::TMetaUtils::GetFullyQualifiedTypeName(buf,fQualType,*fInterp, spec);
return buf.c_str(); // NOLINT
}

Expand Down
7 changes: 6 additions & 1 deletion core/metacling/src/TClingTypeInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@

#include "clang/AST/Type.h"

namespace clang {
class ClassTemplateSpecializationDecl;
}

namespace cling {
class Interpreter;
}
Expand Down Expand Up @@ -65,7 +69,8 @@ class TClingTypeInfo final : public TClingDeclInfo {
void Init(const char *name); // Set type by name.
void Init(clang::QualType ty) { fQualType = ty; }
bool IsValid() const override { return !fQualType.isNull(); }
const char *Name() const override; // Get name of type.
const char *Name() const override { return Name(nullptr); }
const char *Name(const clang::ClassTemplateSpecializationDecl *spec) const; // Get name of type.
long Property() const; // Get properties of type.
int RefType() const; // Get CINT reftype of type.
int Size() const; // Get size in bytes of type.
Expand Down
Loading