12#include "RConfigure.h"
22#include "clang/AST/Decl.h"
23#include "clang/AST/DeclTemplate.h"
25#include "cling/Interpreter/Interpreter.h"
26#include "cling/Interpreter/LookupHelper.h"
28#include "clang/Sema/Sema.h"
29#include "clang/Sema/Template.h"
30#include "clang/Frontend/CompilerInstance.h"
53 clang::QualType thisType =
type;
55 auto typePtr = thisType.getTypePtr();
56 const clang::CXXRecordDecl *stlclass = typePtr->getAsCXXRecordDecl();
63 if (typeForIO.getTypePtr() != typePtr)
64 stlclass = typeForIO->getAsCXXRecordDecl();
70 const clang::ClassTemplateSpecializationDecl *templateCl = llvm::dyn_cast<clang::ClassTemplateSpecializationDecl>(stlclass);
79 const clang::TemplateArgument &arg( templateCl->getTemplateArgs().get(0) );
80 if (arg.getKind() == clang::TemplateArgument::Type) {
81 const clang::NamedDecl *decl = arg.getAsType().getTypePtr()->getAsCXXRecordDecl();
84 llvm::StringRef argname = decl->getName();
85 if ( (argname.str() ==
"bool") || (argname.str() ==
"Bool_t") ) {
86 ROOT::TMetaUtils::Warning(
"std::vector<bool>",
" is not fully supported yet!\nUse std::vector<char> or std::deque<bool> instead.\n");
94 thisType.getTypePtr(),
111 for(
unsigned int i=0; i < templateCl->getTemplateArgs().
size(); ++i) {
112 const clang::TemplateArgument &arg( templateCl->getTemplateArgs().get(i) );
113 if (arg.getKind() == clang::TemplateArgument::Type) {
114 const clang::NamedDecl *decl = arg.getAsType().getTypePtr()->getAsCXXRecordDecl();
118 const clang::CXXRecordDecl *clxx = llvm::dyn_cast<clang::CXXRecordDecl>(decl);
120 if (!clxx->isCompleteDefinition()) {
134 const clang::ClassTemplateSpecializationDecl *templateCl = llvm::dyn_cast<clang::ClassTemplateSpecializationDecl>(stlclass);
144 const clang::TemplateArgument &arg( templateCl->getTemplateArgs().get(0) );
145 if (arg.getKind() == clang::TemplateArgument::Type) {
146 const clang::NamedDecl *decl = arg.getAsType().getTypePtr()->getAsCXXRecordDecl();
149 llvm::StringRef argname = decl->getName();
150 if ( (argname.str() ==
"bool") || (argname.str() ==
"Bool_t") ) {
151 ROOT::TMetaUtils::Warning(
"std::vector<bool>",
" is not fully supported yet!\nUse std::vector<char> or std::deque<bool> instead.\n");
173 for(
unsigned int i=0; i < templateCl->getTemplateArgs().
size(); ++i) {
174 const clang::TemplateArgument &arg( templateCl->getTemplateArgs().get(i) );
175 if (arg.getKind() == clang::TemplateArgument::Type) {
176 const clang::NamedDecl *decl = arg.getAsType().getTypePtr()->getAsCXXRecordDecl();
180 const clang::CXXRecordDecl *clxx = llvm::dyn_cast<clang::CXXRecordDecl>(decl);
182 if (!clxx->isCompleteDefinition()) {
184 clxx = arg.getAsType().getTypePtr()->getAsCXXRecordDecl();
201 fprintf(stderr,
"ROOT::Internal::RStl singleton\n");
202 list_t::iterator iter;
203 for(iter =
fList.begin(); iter !=
fList.end(); ++iter) {
209 const cling::Interpreter &interp,
212 bool &needCollectionProxy,
213 void (*emitStreamerInfo)(
const char*) )
219 list_t::iterator iter;
220 for(iter =
fList.begin(); iter !=
fList.end(); ++iter) {
221 const clang::CXXRecordDecl* result;
223 if (!iter->GetRecordDecl()->getDefinition()) {
227 const cling::LookupHelper& lh = interp.getLookupHelper();
228 result = llvm::dyn_cast_or_null<clang::CXXRecordDecl>(lh.findScope(iter->GetNormalizedName(),
229 cling::LookupHelper::NoDiagnostics,
233 if (!result || !iter->GetRecordDecl()->getDefinition()) {
234 fprintf(stderr,
"Error: incomplete definition for %s\n",iter->GetNormalizedName());
240 result = llvm::dyn_cast<clang::CXXRecordDecl>(iter->GetRecordDecl());
246 if (emitStreamerInfo) emitStreamerInfo(iter->GetNormalizedName());
static Roo_reg_AGKInteg1D instance
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
void GenerateTClassFor(const char *requestedName, const clang::CXXRecordDecl *stlClass, const cling::Interpreter &interp, const ROOT::TMetaUtils::TNormalizedCtxt &normCtxt)
void WriteClassInit(std::ostream &strm, const cling::Interpreter &interp, const ROOT::TMetaUtils::TNormalizedCtxt &normCtxt, const ROOT::TMetaUtils::RConstructorTypes &, bool &needCollectionProxy, void(*emitStreamerInfo)(const char *))
ROOT::ESTLType STLKind(std::string_view type)
Converts STL container name to number.
std::vector< std::string > fElements