ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TMetaUtils.h
Go to the documentation of this file.
1 // @(#)root/metautils:$Id$
2 // Author: Axel Naumann, Nov 2011
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2011, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TMetaUtils
13 #define ROOT_TMetaUtils
14 
15 #include "RConversionRuleParser.h"
16 
17 #include <set>
18 #include <string>
19 #include <unordered_set>
20 
21 //#include <atomic>
22 #include <stdlib.h>
23 
24 namespace llvm {
25  class StringRef;
26 }
27 
28 namespace clang {
29  class ASTContext;
30  class Attr;
31  class ClassTemplateDecl;
32  class ClassTemplateSpecializationDecl;
33  class CompilerInstance;
34  class CXXBaseSpecifier;
35  class CXXRecordDecl;
36  class Decl;
37  class DeclContext;
38  class DeclaratorDecl;
39  class FieldDecl;
40  class FunctionDecl;
41  class Module;
42  class NamedDecl;
43  class ParmVarDecl;
44  class QualType;
45  class RecordDecl;
46  class SourceLocation;
47  class TagDecl;
48  class TemplateDecl;
49  class TemplateName;
50  class TemplateArgument;
51  class TemplateArgumentList;
52  class TemplateParameterList;
53  class Type;
54  class TypeDecl;
55  class TypedefNameDecl;
56  struct PrintingPolicy;
57 }
58 
59 namespace cling {
60  class Interpreter;
61  class LookupHelper;
62  namespace utils {
63  namespace Transform {
64  struct Config;
65  }
66  }
67 }
68 
69 // For ROOT::ESTLType
70 #include "ESTLType.h"
71 
72 // for TClassEdit::TInterpreterLookupHelper
73 #include "TClassEdit.h"
74 
75 #ifndef ROOT_Varargs
76 #include "Varargs.h"
77 #endif
78 
79 namespace ROOT {
80  namespace TMetaUtils {
81 
82 // Forward Declarations --------------------------------------------------------
83 class AnnotatedRecordDecl;
84 
85 // Constants, typedefs and Enums -----------------------------------------------
86 
87 // Convention for the ROOT relevant properties
88 namespace propNames{
89  static const std::string separator("@@@");
90  static const std::string iotype("iotype");
91  static const std::string name("name");
92  static const std::string pattern("pattern");
93  static const std::string ioname("ioname");
94  static const std::string comment("comment");
95  static const std::string nArgsToKeep("nArgsToKeep");
96  static const std::string persistent("persistent");
97  static const std::string transient("transient");
98 }
99 
100 extern int gErrorIgnoreLevel;
101 
102 // Get the array index information for a data member.
104 
106  const cling::Interpreter &interp,
107  const TNormalizedCtxt &normCtxt,
108  std::ostream& dictStream,
109  bool isAutoStreamer);
110 
111 const int kInfo = 0;
112 const int kNote = 500;
113 const int kThrowOnWarning = 999;
114 const int kWarning = 1000;
115 const int kError = 2000;
116 const int kSysError = 3000;
117 const int kFatal = 4000;
118 const int kMaxLen = 1024;
119 
120 // Classes ---------------------------------------------------------------------
121 class TNormalizedCtxtImpl;
122 
123 //______________________________________________________________________________
125 private:
126  TNormalizedCtxtImpl* fImpl;
127 public:
128  using Config_t = cling::utils::Transform::Config;
129  using TypesCont_t = std::set<const clang::Type*>;
130  using TemplPtrIntMap_t = std::map<const clang::ClassTemplateDecl*, int>;
131 
132  TNormalizedCtxt(const cling::LookupHelper &lh);
133  TNormalizedCtxt(const TNormalizedCtxt& other);
135  const Config_t& GetConfig() const;
136  const TypesCont_t &GetTypeWithAlternative() const;
137 
138  void AddTemplAndNargsToKeep(const clang::ClassTemplateDecl* templ, unsigned int i);
139  int GetNargsToKeep(const clang::ClassTemplateDecl* templ) const;
141  void keepTypedef(const cling::LookupHelper &lh, const char* name,
142  bool replace = false);
143 };
144 
145 //______________________________________________________________________________
147 public:
148  typedef bool (*ExistingTypeCheck_t)(const std::string &tname, std::string &result);
149  typedef bool (*AutoParse_t)(const char *name);
150 
151 private:
152  cling::Interpreter *fInterpreter;
156  const int *fPDebug; // debug flag, might change at runtime thus *
157  bool WantDiags() const { return fPDebug && *fPDebug > 5; }
158 
159 public:
160  TClingLookupHelper(cling::Interpreter &interpreter, TNormalizedCtxt &normCtxt,
161  ExistingTypeCheck_t existingTypeCheck,
162  AutoParse_t autoParse,
163  const int *pgDebug = 0);
164  virtual ~TClingLookupHelper() { /* we're not owner */ }
165 
166  virtual bool ExistingTypeCheck(const std::string &tname, std::string &result);
167  virtual void GetPartiallyDesugaredName(std::string &nameLong);
168  virtual bool IsAlreadyPartiallyDesugaredName(const std::string &nondef, const std::string &nameLong);
169  virtual bool IsDeclaredScope(const std::string &base, bool &isInlined);
170  virtual bool GetPartiallyDesugaredNameWithScopeHandling(const std::string &tname, std::string &result);
171 };
172 
173 //______________________________________________________________________________
175 private:
177  const clang::RecordDecl* fDecl;
178  std::string fRequestedName;
179  std::string fNormalizedName;
185 
186 public:
187  enum ERootFlag {
188  kNoStreamer = 0x01,
192  kHasVersion = 0x08
193  };
194 
195  AnnotatedRecordDecl(long index,
196  const clang::RecordDecl *decl,
197  bool rStreamerInfo,
198  bool rNoStreamer,
199  bool rRequestNoInputOperator,
200  bool rRequestOnlyTClass,
201  int rRequestedVersionNumber,
202  const cling::Interpreter &interpret,
203  const TNormalizedCtxt &normCtxt);
204 
205  AnnotatedRecordDecl(long index,
206  const clang::RecordDecl *decl,
207  const char *requestName,
208  bool rStreamerInfo,
209  bool rNoStreamer,
210  bool rRequestNoInputOperator,
211  bool rRequestOnlyTClass,
212  int rRequestedVersionNumber,
213  const cling::Interpreter &interpret,
214  const TNormalizedCtxt &normCtxt);
215 
216  AnnotatedRecordDecl(long index,
217  const clang::Type *requestedType,
218  const clang::RecordDecl *decl,
219  const char *requestedName,
220  bool rStreamerInfo,
221  bool rNoStreamer,
222  bool rRequestNoInputOperator,
223  bool rRequestOnlyTClass,
224  int rRequestedVersionNumber,
225  const cling::Interpreter &interpret,
226  const TNormalizedCtxt &normCtxt);
227 
228  AnnotatedRecordDecl(long index,
229  const clang::Type *requestedType,
230  const clang::RecordDecl *decl,
231  const char *requestedName,
232  unsigned int nTemplateArgsToSkip,
233  bool rStreamerInfo,
234  bool rNoStreamer,
235  bool rRequestNoInputOperator,
236  bool rRequestOnlyTClass,
237  int rRequestedVersionNumber,
238  const cling::Interpreter &interpret,
239  const TNormalizedCtxt &normCtxt);
240 
242  // Nothing to do we do not own the pointer;
243  }
244 
245 
246  long GetRuleIndex() const { return fRuleIndex; }
247 
248  const char *GetRequestedName() const { return fRequestedName.c_str(); }
249  const char *GetNormalizedName() const { return fNormalizedName.c_str(); }
250  bool HasClassVersion() const { return fRequestedVersionNumber >=0 ; }
251  bool RequestStreamerInfo() const {
252  // Equivalent to CINT's cl.RootFlag() & G__USEBYTECOUNT
253  return fRequestStreamerInfo;
254  }
256  bool RequestNoStreamer() const { return fRequestNoStreamer; }
257  bool RequestOnlyTClass() const { return fRequestOnlyTClass; }
259  int RootFlag() const {
260  // Return the request (streamerInfo, has_version, etc.) combined in a single
261  // int. See RScanner::AnnotatedRecordDecl::ERootFlag.
262  int result = 0;
263  if (fRequestNoStreamer) result = kNoStreamer;
265  if (fRequestStreamerInfo) result |= kStreamerInfo;
266  if (fRequestedVersionNumber > -1) result |= kHasVersion;
267  return result;
268  }
269  const clang::RecordDecl* GetRecordDecl() const { return fDecl; }
270 
271  operator clang::RecordDecl const *() const {
272  return fDecl;
273  }
274 
275  bool operator<(const AnnotatedRecordDecl& right) const
276  {
277  return fRuleIndex < right.fRuleIndex;
278  }
279 
280  struct CompareByName {
281  bool operator() (const AnnotatedRecordDecl& right, const AnnotatedRecordDecl& left)
282  {
283  return left.fNormalizedName < right.fNormalizedName;
284  }
285  };
286 };
287 
288 //______________________________________________________________________________
290 private:
291  const std::string fArgTypeName;
292  const clang::CXXRecordDecl *fArgType;
293 
294 public:
295  RConstructorType(const char *type_of_arg, const cling::Interpreter&);
296 
297  const char *GetName() const ;
298  const clang::CXXRecordDecl *GetType() const;
299 };
300 typedef std::list<RConstructorType> RConstructorTypes;
301 
302 // Functions -------------------------------------------------------------------
303 
304 //_____________________________________________________________________________
305 unsigned int GetNumberOfWarningsAndErrors();
306 
307 //______________________________________________________________________________
308 int extractAttrString(clang::Attr* attribute, std::string& attrString);
309 
310 //______________________________________________________________________________
311 int extractPropertyNameValFromString(const std::string attributeStr,std::string& attrName, std::string& attrValue);
312 
313 //______________________________________________________________________________
314 int extractPropertyNameVal(clang::Attr* attribute, std::string& attrName, std::string& attrValue);
315 
316 //______________________________________________________________________________
317 bool ExtractAttrPropertyFromName(const clang::Decl& decl,
318  const std::string& propName,
319  std::string& propValue);
320 
321 //______________________________________________________________________________
322 bool ExtractAttrIntPropertyFromName(const clang::Decl& decl,
323  const std::string& propName,
324  int& propValue);
325 
326 //______________________________________________________________________________
327 bool RequireCompleteType(const cling::Interpreter &interp, const clang::CXXRecordDecl *cl);
328 
329 //______________________________________________________________________________
330 bool RequireCompleteType(const cling::Interpreter &interp, clang::SourceLocation Loc, clang::QualType Type);
331 
332 //______________________________________________________________________________
333 // Add default template parameters.
334 clang::QualType AddDefaultParameters(clang::QualType instanceType,
335  const cling::Interpreter &interpret,
336  const TNormalizedCtxt &normCtxt);
337 
338 //______________________________________________________________________________
339 llvm::StringRef DataMemberInfo__ValidArrayIndex(const clang::DeclaratorDecl &m, int *errnum = 0, llvm::StringRef *errstr = 0);
340 
341 //______________________________________________________________________________
342 // Return the ROOT include directory
343 std::string GetROOTIncludeDir(bool rootbuild);
344 
346 
347 //______________________________________________________________________________
348 EIOCtorCategory CheckConstructor(const clang::CXXRecordDecl*, const RConstructorType&);
349 
350 //______________________________________________________________________________
351 const clang::FunctionDecl* ClassInfo__HasMethod(const clang::DeclContext *cl, char const*, const cling::Interpreter& interp);
352 
353 //______________________________________________________________________________
354 void CreateNameTypeMap(clang::CXXRecordDecl const&, std::map<std::string, ROOT::Internal::TSchemaType, std::less<std::string>, std::allocator<std::pair<std::string const, ROOT::Internal::TSchemaType> > >&);
355 
356 //______________________________________________________________________________
357 int ElementStreamer(std::ostream& finalString,
358  const clang::NamedDecl &forcontext,
359  const clang::QualType &qti,
360  const char *t,
361  int rwmode,
362  const cling::Interpreter &interp,
363  const char *tcl=0);
364 
365 //______________________________________________________________________________
366 bool IsBase(const clang::CXXRecordDecl *cl, const clang::CXXRecordDecl *base, const clang::CXXRecordDecl *context,const cling::Interpreter &interp);
367 
368 //______________________________________________________________________________
369 bool IsBase(const clang::FieldDecl &m, const char* basename, const cling::Interpreter &interp);
370 
371 //______________________________________________________________________________
372 bool HasCustomOperatorNewArrayPlacement(clang::RecordDecl const&, const cling::Interpreter &interp);
373 
374 //______________________________________________________________________________
375 bool HasCustomOperatorNewPlacement(char const*, clang::RecordDecl const&, const cling::Interpreter&);
376 
377 //______________________________________________________________________________
378 bool HasCustomOperatorNewPlacement(clang::RecordDecl const&, const cling::Interpreter&);
379 
380 //______________________________________________________________________________
381 bool HasDirectoryAutoAdd(clang::CXXRecordDecl const*, const cling::Interpreter&);
382 
383 //______________________________________________________________________________
384 bool HasIOConstructor(clang::CXXRecordDecl const*, std::string&, const RConstructorTypes&, const cling::Interpreter&);
385 
386 //______________________________________________________________________________
387 bool HasNewMerge(clang::CXXRecordDecl const*, const cling::Interpreter&);
388 
389 //______________________________________________________________________________
390 bool HasOldMerge(clang::CXXRecordDecl const*, const cling::Interpreter&);
391 
392 //______________________________________________________________________________
393 bool hasOpaqueTypedef(clang::QualType instanceType, const TNormalizedCtxt &normCtxt);
394 
395 //______________________________________________________________________________
396 bool hasOpaqueTypedef(const AnnotatedRecordDecl &cl, const cling::Interpreter &interp, const TNormalizedCtxt &normCtxt);
397 
398 //______________________________________________________________________________
399 bool HasResetAfterMerge(clang::CXXRecordDecl const*, const cling::Interpreter&);
400 
401 //______________________________________________________________________________
402 bool NeedDestructor(clang::CXXRecordDecl const*);
403 
404 //______________________________________________________________________________
405 bool NeedTemplateKeyword(clang::CXXRecordDecl const*);
406 
407 //______________________________________________________________________________
408 bool CheckPublicFuncWithProto(clang::CXXRecordDecl const*, char const*, char const*,
409  const cling::Interpreter&, bool diagnose);
410 
411 //______________________________________________________________________________
412 long GetLineNumber(clang::Decl const*);
413 
414 //______________________________________________________________________________
415 bool GetNameWithinNamespace(std::string&, std::string&, std::string&, clang::CXXRecordDecl const*);
416 
417 //______________________________________________________________________________
418 void GetQualifiedName(std::string &qual_name, const clang::QualType &type, const clang::NamedDecl &forcontext);
419 
420 //----
421 std::string GetQualifiedName(const clang::QualType &type, const clang::NamedDecl &forcontext);
422 
423 //______________________________________________________________________________
424 void GetQualifiedName(std::string &qual_name, const clang::Type &type, const clang::NamedDecl &forcontext);
425 
426 //----
427 std::string GetQualifiedName(const clang::Type &type, const clang::NamedDecl &forcontext);
428 
429 //______________________________________________________________________________
430 void GetQualifiedName(std::string &qual_name, const clang::NamedDecl &nd);
431 
432 //----
433 std::string GetQualifiedName(const clang::NamedDecl &nd);
434 
435 //______________________________________________________________________________
436 void GetQualifiedName(std::string &qual_name, const AnnotatedRecordDecl &annotated);
437 
438 //----
439 std::string GetQualifiedName(const AnnotatedRecordDecl &annotated);
440 
441 //______________________________________________________________________________
442 void GetQualifiedName(std::string &qual_name, const clang::RecordDecl &recordDecl);
443 
444 //----
445 std::string GetQualifiedName(const clang::RecordDecl &recordDecl);
446 
447 //______________________________________________________________________________
448 int WriteNamespaceHeader(std::ostream&, const clang::RecordDecl *);
449 
450 //______________________________________________________________________________
451 int WriteNamespaceHeader(std::ostream&, const clang::DeclContext *);
452 
453 //______________________________________________________________________________
454 void WritePointersSTL(const AnnotatedRecordDecl &cl, const cling::Interpreter &interp, const TNormalizedCtxt &normCtxt);
455 
456 //______________________________________________________________________________
457 int GetClassVersion(const clang::RecordDecl *cl, const cling::Interpreter &interp);
458 
459 //______________________________________________________________________________
460 int IsSTLContainer(const AnnotatedRecordDecl &annotated);
461 
462 //______________________________________________________________________________
463 ROOT::ESTLType IsSTLContainer(const clang::FieldDecl &m);
464 
465 //______________________________________________________________________________
466 int IsSTLContainer(const clang::CXXBaseSpecifier &base);
467 
468 //______________________________________________________________________________
469 const char *ShortTypeName(const char *typeDesc);
470 
471 //______________________________________________________________________________
472 std::string ShortTypeName(const clang::FieldDecl &m);
473 
474 //______________________________________________________________________________
475 bool IsStreamableObject(const clang::FieldDecl &m, const cling::Interpreter& interp);
476 
477 //______________________________________________________________________________
478 clang::RecordDecl *GetUnderlyingRecordDecl(clang::QualType type);
479 
480 //______________________________________________________________________________
481 std::string TrueName(const clang::FieldDecl &m);
482 
483 //______________________________________________________________________________
484 const clang::CXXRecordDecl *ScopeSearch(const char *name,
485  const cling::Interpreter &gInterp,
486  bool diagnose,
487  const clang::Type** resultType);
488 
489 //______________________________________________________________________________
490 void WriteAuxFunctions(std::ostream& finalString,
491  const AnnotatedRecordDecl &cl,
492  const clang::CXXRecordDecl *decl,
493  const cling::Interpreter &interp,
494  const RConstructorTypes& ctorTypes,
495  const TNormalizedCtxt &normCtxt);
496 
497 
498 //______________________________________________________________________________
499 const clang::FunctionDecl *GetFuncWithProto(const clang::Decl* cinfo,
500  const char *method,
501  const char *proto,
502  const cling::Interpreter &gInterp,
503  bool diagnose);
504 
505 //______________________________________________________________________________
506 void WriteClassCode(CallWriteStreamer_t WriteStreamerFunc,
507  const AnnotatedRecordDecl &cl,
508  const cling::Interpreter &interp,
509  const TNormalizedCtxt &normCtxt,
510  std::ostream& finalString,
511  const RConstructorTypes& ctorTypes,
512  bool isGenreflex);
513 
514 //______________________________________________________________________________
515 void WriteClassInit(std::ostream& finalString,
516  const AnnotatedRecordDecl &cl,
517  const clang::CXXRecordDecl *decl,
518  const cling::Interpreter &interp,
519  const TNormalizedCtxt &normCtxt,
520  const RConstructorTypes& ctorTypes,
521  bool& needCollectionProxy);
522 
523 //______________________________________________________________________________
524 bool HasCustomStreamerMemberFunction(const AnnotatedRecordDecl &cl,
525  const clang::CXXRecordDecl* clxx,
526  const cling::Interpreter &interp,
527  const TNormalizedCtxt &normCtxt);
528 
529 //______________________________________________________________________________
530 bool HasCustomConvStreamerMemberFunction(const AnnotatedRecordDecl &cl,
531  const clang::CXXRecordDecl* clxx,
532  const cling::Interpreter &interp,
533  const TNormalizedCtxt &normCtxt);
534 
535 //______________________________________________________________________________
536 // Return the header file to be included to declare the Decl
537 llvm::StringRef GetFileName(const clang::Decl& decl,
538  const cling::Interpreter& interp);
539 
540 //______________________________________________________________________________
541 // Return the dictionary file name for a module
542 std::string GetModuleFileName(const char* moduleName);
543 
544 //______________________________________________________________________________
545 // Declare a virtual module.map to clang. Returns Module on success.
546 clang::Module* declareModuleMap(clang::CompilerInstance* CI,
547  const char* moduleFileName,
548  const char* headers[]);
549 
550 //______________________________________________________________________________
551 // Return the -I needed to find RuntimeUniverse.h
552 std::string GetInterpreterExtraIncludePath(bool rootbuild);
553 
554 //______________________________________________________________________________
555 // Return the LLVM / clang resource directory
556 std::string GetLLVMResourceDir(bool rootbuild);
557 
558 //______________________________________________________________________________
559 // Return the ROOT include directory
560 std::string GetROOTIncludeDir(bool rootbuild);
561 
562 //______________________________________________________________________________
563 // Return (in the argument 'output') a mangled version of the C++ symbol/type (pass as 'input')
564 // that can be used in C++ as a variable name.
565 void GetCppName(std::string &output, const char *input);
566 
567 //______________________________________________________________________________
568 // Return the type with all parts fully qualified (most typedefs),
569 // including template arguments, appended to name.
570 void GetFullyQualifiedTypeName(std::string &name, const clang::QualType &type, const cling::Interpreter &interpreter);
571 
572 //______________________________________________________________________________
573 // Return the type with all parts fully qualified (most typedefs),
574 // including template arguments, appended to name, without using the interpreter
575 void GetFullyQualifiedTypeName(std::string &name, const clang::QualType &type, const clang::ASTContext &);
576 
577 //______________________________________________________________________________
578 // Return the type normalized for ROOT,
579 // keeping only the ROOT opaque typedef (Double32_t, etc.) and
580 // adding default template argument for all types except those explicitly
581 // requested to be drop by the user.
582 // Default template for STL collections are not yet removed by this routine.
583 clang::QualType GetNormalizedType(const clang::QualType &type, const cling::Interpreter &interpreter, const TNormalizedCtxt &normCtxt);
584 
585 //______________________________________________________________________________
586 // Return the type name normalized for ROOT,
587 // keeping only the ROOT opaque typedef (Double32_t, etc.) and
588 // adding default template argument for all types except the STL collections
589 // where we remove the default template argument if any.
590 void GetNormalizedName(std::string &norm_name, const clang::QualType &type, const cling::Interpreter &interpreter, const TNormalizedCtxt &normCtxt);
591 
592 //______________________________________________________________________________
593 // Alternative signature
594 void GetNormalizedName(std::string &norm_name,
595  const clang::TypeDecl* typeDecl,
596  const cling::Interpreter &interpreter);
597 
598 //______________________________________________________________________________
599 // Returns comment in a meaningful way
600 llvm::StringRef GetComment(const clang::Decl &decl, clang::SourceLocation *loc = 0);
601 
602 //______________________________________________________________________________
603 // Returns the comment of the ClassDef macro
604 llvm::StringRef GetClassComment(const clang::CXXRecordDecl &decl, clang::SourceLocation *loc, const cling::Interpreter &interpreter);
605 
606 //______________________________________________________________________________
607 // Return the base/underlying type of a chain of array or pointers type.
608 const clang::Type *GetUnderlyingType(clang::QualType type);
609 
610 //______________________________________________________________________________
611 // Scans the redeclaration chain for an annotation.
612 //
613 // returns 0 if no annotation was found.
614 //
615 template<typename T>
616 const T* GetAnnotatedRedeclarable(const T* Redecl) {
617  if (!Redecl)
618  return 0;
619 
620  Redecl = Redecl->getMostRecentDecl();
621  while (Redecl && !Redecl->hasAttrs())
622  Redecl = Redecl->getPreviousDecl();
623 
624  return Redecl;
625 }
626 
627 //______________________________________________________________________________
628 // Overload the template for typedefs, because they don't contain
629 // isThisDeclarationADefinition method. (Use inline to avoid violating ODR)
630 const clang::TypedefNameDecl* GetAnnotatedRedeclarable(const clang::TypedefNameDecl* TND);
631 
632 //______________________________________________________________________________
633 // Overload the template for tags, because we only check definitions.
634 const clang::TagDecl* GetAnnotatedRedeclarable(const clang::TagDecl* TND);
635 
636 //______________________________________________________________________________
637 // Return true if the decl is part of the std namespace.
638 bool IsStdClass(const clang::RecordDecl &cl);
639 
640 //______________________________________________________________________________
641 // Return true, if the decl is part of the std namespace and we want
642 // its default parameter dropped.
643 bool IsStdDropDefaultClass(const clang::RecordDecl &cl);
644 
645 //______________________________________________________________________________
646 // See if the CXXRecordDecl matches the current of any of the previous CXXRecordDecls
647 bool MatchWithDeclOrAnyOfPrevious(const clang::CXXRecordDecl &cl, const clang::CXXRecordDecl &currentCl);
648 
649 //______________________________________________________________________________
650 // Return true if the decl is of type
651 bool IsOfType(const clang::CXXRecordDecl &cl, const std::string& type, const cling::LookupHelper& lh);
652 
653 //______________________________________________________________________________
654 // Return which kind of STL container the decl is, if any.
655 ROOT::ESTLType IsSTLCont(const clang::RecordDecl &cl);
656 
657 //______________________________________________________________________________
658 // Check if 'input' or any of its template parameter was substituted when
659 // instantiating the class template instance and replace it with the
660 // partially sugared type we have from 'instance'.
661 clang::QualType ReSubstTemplateArg(clang::QualType input, const clang::Type *instance);
662 
663 //______________________________________________________________________________
664 // Remove the last n template arguments from the name
665 int RemoveTemplateArgsFromName(std::string& name, unsigned int);
666 
667 //______________________________________________________________________________
668 clang::TemplateName ExtractTemplateNameFromQualType(const clang::QualType& qt);
669 
670 //______________________________________________________________________________
671 bool QualType2Template(const clang::QualType& qt,
672  clang::ClassTemplateDecl*& ctd,
673  clang::ClassTemplateSpecializationDecl*& ctsd);
674 
675 //______________________________________________________________________________
676 clang::ClassTemplateDecl* QualType2ClassTemplateDecl(const clang::QualType& qt);
677 
678 //______________________________________________________________________________
679 // Extract the namespaces enclosing a DeclContext
680 void ExtractCtxtEnclosingNameSpaces(const clang::DeclContext&,
681  std::list<std::pair<std::string,bool> >&);
682 //______________________________________________________________________________
683 void ExtractEnclosingNameSpaces(const clang::Decl&,
684  std::list<std::pair<std::string,bool> >&);
685 
686 //______________________________________________________________________________
687 const clang::RecordDecl* ExtractEnclosingScopes(const clang::Decl& decl,
688  std::list<std::pair<std::string,unsigned int> >& enclosingSc);
689 //______________________________________________________________________________
690 // Kind of stl container
691 ROOT::ESTLType STLKind(const llvm::StringRef type);
692 
693 //______________________________________________________________________________
694 // Set the toolchain and the include paths for relocatability
695 void SetPathsForRelocatability(std::vector<std::string>& clingArgs);
696 
697 //______________________________________________________________________________
698 void ReplaceAll(std::string& str, const std::string& from, const std::string& to, bool recurse=false);
699 
700 // Functions for the printouts -------------------------------------------------
701 
702 //______________________________________________________________________________
703 void LevelPrint(bool prefix, int level, const char *location, const char *fmt, va_list ap);
704 
705 //______________________________________________________________________________
706 void Error(const char *location, const char *va_(fmt), ...);
707 
708 //______________________________________________________________________________
709 void SysError(const char *location, const char *va_(fmt), ...);
710 
711 //______________________________________________________________________________
712 void Info(const char *location, const char *va_(fmt), ...);
713 
714 //______________________________________________________________________________
715 void Warning(const char *location, const char *va_(fmt), ...);
716 
717 //______________________________________________________________________________
718 void Fatal(const char *location, const char *va_(fmt), ...);
719 
720 //______________________________________________________________________________
721 const std::string& GetPathSeparator();
722 
723 //______________________________________________________________________________
724 bool EndsWith(const std::string &theString, const std::string &theSubstring);
725 
726 //______________________________________________________________________________
727 bool BeginsWith(const std::string &theString, const std::string &theSubstring);
728 
729 //______________________________________________________________________________
730 namespace AST2SourceTools {
731 
732 //______________________________________________________________________________
733 const std::string Decls2FwdDecls(const std::vector<const clang::Decl*> &decls,
734  const cling::Interpreter& interp);
735 
736 //______________________________________________________________________________
737 int PrepareArgsForFwdDecl(std::string& templateArgs,
738  const clang::TemplateParameterList& tmplParamList,
739  const cling::Interpreter& interpreter);
740 
741 //______________________________________________________________________________
742 int EncloseInNamespaces(const clang::Decl& decl, std::string& defString);
743 
744 //______________________________________________________________________________
745 const clang::RecordDecl* EncloseInScopes(const clang::Decl& decl, std::string& defString);
746 
747 //______________________________________________________________________________
748 int FwdDeclFromRcdDecl(const clang::RecordDecl& recordDecl,
749  const cling::Interpreter& interpreter,
750  std::string& defString,
751  bool acceptStl=false);
752 
753 //______________________________________________________________________________
754 int FwdDeclFromTmplDecl(const clang::TemplateDecl& tmplDecl,
755  const cling::Interpreter& interpreter,
756  std::string& defString);
757 //______________________________________________________________________________
758 int GetDefArg(const clang::ParmVarDecl& par, std::string& valAsString, const clang::PrintingPolicy& pp);
759 
760 //______________________________________________________________________________
761 int FwdDeclFromFcnDecl(const clang::FunctionDecl& fcnDecl,
762  const cling::Interpreter& interpreter,
763  std::string& defString);
764 //______________________________________________________________________________
765 int FwdDeclFromTypeDefNameDecl(const clang::TypedefNameDecl& tdnDecl,
766  const cling::Interpreter& interpreter,
767  std::string& fwdDeclString,
768  std::unordered_set<std::string>* fwdDeclSet=nullptr);
769 
770 } // namespace AST2SourceTools
771 
772 } // namespace TMetaUtils
773 
774 } // namespace ROOT
775 
776 #endif // ROOT_TMetaUtils
bool NeedTemplateKeyword(clang::CXXRecordDecl const *)
void CreateNameTypeMap(clang::CXXRecordDecl const &, std::map< std::string, ROOT::Internal::TSchemaType, std::less< std::string >, std::allocator< std::pair< std::string const, ROOT::Internal::TSchemaType > > > &)
const clang::RecordDecl * ExtractEnclosingScopes(const clang::Decl &decl, std::list< std::pair< std::string, unsigned int > > &enclosingSc)
Extract the names and types of containing scopes.
double par[1]
Definition: unuranDistr.cxx:38
int extractPropertyNameValFromString(const std::string attributeStr, std::string &attrName, std::string &attrValue)
static const std::string nArgsToKeep("nArgsToKeep")
int GetClassVersion(const clang::RecordDecl *cl, const cling::Interpreter &interp)
Return the version number of the class or -1 if the function Class_Version does not exist...
ESTLType
Definition: ESTLType.h:28
bool IsStreamableObject(const clang::FieldDecl &m, const cling::Interpreter &interp)
int GetDefArg(const clang::ParmVarDecl &par, std::string &valAsString, const clang::PrintingPolicy &pp)
Get the default value as string.
void AddTemplAndNargsToKeep(const clang::ClassTemplateDecl *templ, unsigned int i)
Definition: TMetaUtils.cxx:341
const int kNote
Definition: TMetaUtils.h:112
llvm::StringRef GetFileName(const clang::Decl &decl, const cling::Interpreter &interp)
Return the header file to be included to declare the Decl.
cling::Interpreter * gInterp
cling::Interpreter * fInterpreter
Definition: TMetaUtils.h:152
long GetLineNumber(clang::Decl const *)
It looks like the template specialization decl actually contains less information on the location of ...
bool CheckPublicFuncWithProto(clang::CXXRecordDecl const *, char const *, char const *, const cling::Interpreter &, bool diagnose)
Return true, if the function (defined by the name and prototype) exists and is public.
static const std::string comment("comment")
const char * ShortTypeName(const char *typeDesc)
Return the absolute type of typeDesc.
void Error(const char *location, const char *va_(fmt),...)
Use this function in case an error occured.
void(* CallWriteStreamer_t)(const AnnotatedRecordDecl &cl, const cling::Interpreter &interp, const TNormalizedCtxt &normCtxt, std::ostream &dictStream, bool isAutoStreamer)
Definition: TMetaUtils.h:105
std::map< const clang::ClassTemplateDecl *, int > TemplPtrIntMap_t
Definition: TMetaUtils.h:130
clang::RecordDecl * GetUnderlyingRecordDecl(clang::QualType type)
std::string GetLLVMResourceDir(bool rootbuild)
Return the LLVM / clang resource directory.
clang::QualType ReSubstTemplateArg(clang::QualType input, const clang::Type *instance)
Check if 'input' or any of its template parameter was substituted when instantiating the class templa...
llvm::StringRef DataMemberInfo__ValidArrayIndex(const clang::DeclaratorDecl &m, int *errnum=0, llvm::StringRef *errstr=0)
ValidArrayIndex return a static string (so use it or copy it immediatly, do not call GrabIndex twice ...
static const std::string iotype("iotype")
TNormalizedCtxt(const cling::LookupHelper &lh)
Definition: TMetaUtils.cxx:324
void GetFullyQualifiedTypeName(std::string &name, const clang::QualType &type, const cling::Interpreter &interpreter)
void GetCppName(std::string &output, const char *input)
Return (in the argument 'output') a mangled version of the C++ symbol/type (pass as 'input') that can...
unsigned int GetNumberOfWarningsAndErrors()
Definition: TMetaUtils.cxx:67
bool operator()(const AnnotatedRecordDecl &right, const AnnotatedRecordDecl &left)
Definition: TMetaUtils.h:281
void GetQualifiedName(std::string &qual_name, const clang::QualType &type, const clang::NamedDecl &forcontext)
Main implementation relying on GetFullyQualifiedTypeName All other GetQualifiedName functions leverag...
int GetNargsToKeep(const clang::ClassTemplateDecl *templ) const
Definition: TMetaUtils.cxx:345
bool ExtractAttrPropertyFromName(const clang::Decl &decl, const std::string &propName, std::string &propValue)
This routine counts on the "propName<separator>propValue" format.
int RemoveTemplateArgsFromName(std::string &name, unsigned int)
Remove the last n template arguments from the name.
DataMemberInfo__ValidArrayIndex_error_code
Definition: TMetaUtils.h:103
TClingLookupHelper(cling::Interpreter &interpreter, TNormalizedCtxt &normCtxt, ExistingTypeCheck_t existingTypeCheck, AutoParse_t autoParse, const int *pgDebug=0)
Definition: TMetaUtils.cxx:469
int extractAttrString(clang::Attr *attribute, std::string &attrString)
Extract attr string.
ExistingTypeCheck_t fExistingTypeCheck
Definition: TMetaUtils.h:154
bool HasDirectoryAutoAdd(clang::CXXRecordDecl const *, const cling::Interpreter &)
Return true if the class has a method DirectoryAutoAdd(TDirectory *)
TTree * T
const TypesCont_t & GetTypeWithAlternative() const
Definition: TMetaUtils.cxx:338
bool hasOpaqueTypedef(clang::QualType instanceType, const TNormalizedCtxt &normCtxt)
Return true if the type is a Double32_t or Float16_t or is a instance template that depends on Double...
const clang::Type * GetUnderlyingType(clang::QualType type)
Return the base/underlying type of a chain of array or pointers type.
virtual bool ExistingTypeCheck(const std::string &tname, std::string &result)
Helper routine to ry hard to avoid looking up in the Cling database as this could enduce an unwanted ...
Definition: TMetaUtils.cxx:484
const Config_t & GetConfig() const
Definition: TMetaUtils.cxx:335
bool HasCustomConvStreamerMemberFunction(const AnnotatedRecordDecl &cl, const clang::CXXRecordDecl *clxx, const cling::Interpreter &interp, const TNormalizedCtxt &normCtxt)
Return true if the class has a custom member function streamer.
static const std::string separator("@@@")
bool MatchWithDeclOrAnyOfPrevious(const clang::CXXRecordDecl &cl, const clang::CXXRecordDecl &currentCl)
This is a recursive function.
int FwdDeclFromTypeDefNameDecl(const clang::TypedefNameDecl &tdnDecl, const cling::Interpreter &interpreter, std::string &fwdDeclString, std::unordered_set< std::string > *fwdDeclSet=nullptr)
Extract "forward declaration" of a typedef.
const int kThrowOnWarning
Definition: TMetaUtils.h:113
virtual void GetPartiallyDesugaredName(std::string &nameLong)
Definition: TMetaUtils.cxx:495
bool BeginsWith(const std::string &theString, const std::string &theSubstring)
bool IsStdDropDefaultClass(const clang::RecordDecl &cl)
Return true, if the decl is part of the std namespace and we want its default parameter dropped...
int FwdDeclFromRcdDecl(const clang::RecordDecl &recordDecl, const cling::Interpreter &interpreter, std::string &defString, bool acceptStl=false)
Convert a rcd decl to its fwd decl If this is a template specialisation, treat in the proper way...
bool(* ExistingTypeCheck_t)(const std::string &tname, std::string &result)
Definition: TMetaUtils.h:148
const TemplPtrIntMap_t GetTemplNargsToKeepMap() const
Definition: TMetaUtils.cxx:349
static const std::string pattern("pattern")
#define va_(arg)
Definition: Varargs.h:41
bool(* AutoParse_t)(const char *name)
Definition: TMetaUtils.h:149
bool HasNewMerge(clang::CXXRecordDecl const *, const cling::Interpreter &)
Return true if the class has a method Merge(TCollection*,TFileMergeInfo*)
bool IsStdClass(const clang::RecordDecl &cl)
Return true, if the decl is part of the std namespace.
std::string GetModuleFileName(const char *moduleName)
Return the dictionary file name for a module.
std::string GetInterpreterExtraIncludePath(bool rootbuild)
Return the -I needed to find RuntimeUniverse.h.
int EncloseInNamespaces(const clang::Decl &decl, std::string &defString)
Take the namespaces which enclose the decl and put them around the definition string.
void WriteClassInit(std::ostream &finalString, const AnnotatedRecordDecl &cl, const clang::CXXRecordDecl *decl, const cling::Interpreter &interp, const TNormalizedCtxt &normCtxt, const RConstructorTypes &ctorTypes, bool &needCollectionProxy)
FIXME: a function of ~300 lines!
const int kError
Definition: TMetaUtils.h:115
void WritePointersSTL(const AnnotatedRecordDecl &cl, const cling::Interpreter &interp, const TNormalizedCtxt &normCtxt)
Write interface function for STL members.
void Info(const char *location, const char *va_(fmt),...)
Use this function for informational messages.
void WriteAuxFunctions(std::ostream &finalString, const AnnotatedRecordDecl &cl, const clang::CXXRecordDecl *decl, const cling::Interpreter &interp, const RConstructorTypes &ctorTypes, const TNormalizedCtxt &normCtxt)
std::string NormalizedName; GetNormalizedName(NormalizedName, decl->getASTContext().getTypeDeclType(decl), interp, normCtxt);
int WriteNamespaceHeader(std::ostream &, const clang::RecordDecl *)
int extractPropertyNameVal(clang::Attr *attribute, std::string &attrName, std::string &attrValue)
const clang::FunctionDecl * GetFuncWithProto(const clang::Decl *cinfo, const char *method, const char *proto, const cling::Interpreter &gInterp, bool diagnose)
bool HasOldMerge(clang::CXXRecordDecl const *, const cling::Interpreter &)
Return true if the class has a method Merge(TCollection*)
const clang::RecordDecl * GetRecordDecl() const
Definition: TMetaUtils.h:269
void GetNormalizedName(std::string &norm_name, const clang::QualType &type, const cling::Interpreter &interpreter, const TNormalizedCtxt &normCtxt)
Return the type name normalized for ROOT, keeping only the ROOT opaque typedef (Double32_t, etc.) and adding default template argument for all types except the STL collections where we remove the default template argument if any.
int FwdDeclFromTmplDecl(const clang::TemplateDecl &tmplDecl, const cling::Interpreter &interpreter, std::string &defString)
Convert a tmplt decl to its fwd decl.
virtual bool IsAlreadyPartiallyDesugaredName(const std::string &nondef, const std::string &nameLong)
Definition: TMetaUtils.cxx:511
bool ExtractAttrIntPropertyFromName(const clang::Decl &decl, const std::string &propName, int &propValue)
This routine counts on the "propName<separator>propValue" format.
std::list< RConstructorType > RConstructorTypes
Definition: TMetaUtils.h:300
TThread * t[5]
Definition: threadsh1.C:13
const std::string & GetPathSeparator()
Return the separator suitable for this platform.
int PrepareArgsForFwdDecl(std::string &templateArgs, const clang::TemplateParameterList &tmplParamList, const cling::Interpreter &interpreter)
Loop over the template parameters and build a string for template arguments using the fully qualified...
std::string TrueName(const clang::FieldDecl &m)
TrueName strips the typedefs and array dimensions.
const clang::RecordDecl * EncloseInScopes(const clang::Decl &decl, std::string &defString)
Take the scopes which enclose the decl and put them around the definition string. ...
bool HasCustomStreamerMemberFunction(const AnnotatedRecordDecl &cl, const clang::CXXRecordDecl *clxx, const cling::Interpreter &interp, const TNormalizedCtxt &normCtxt)
Return true if the class has a custom member function streamer.
ROOT::ESTLType STLKind(const llvm::StringRef type)
Converts STL container name to number. vector -> 1, etc..
const clang::CXXRecordDecl * ScopeSearch(const char *name, const cling::Interpreter &gInterp, bool diagnose, const clang::Type **resultType)
Return the scope corresponding to 'name' or std::'name'.
Definition: TMetaUtils.cxx:710
const T * GetAnnotatedRedeclarable(const T *Redecl)
Definition: TMetaUtils.h:616
const clang::CXXRecordDecl * GetType() const
bool RequireCompleteType(const cling::Interpreter &interp, const clang::CXXRecordDecl *cl)
Definition: TMetaUtils.cxx:733
TMarker * m
Definition: textangle.C:8
const int kMaxLen
Definition: TMetaUtils.h:118
ROOT::ESTLType IsSTLCont(const clang::RecordDecl &cl)
type : type name: vector<list<classA,allocator>,allocator> result: 0 : not stl container abs(result):...
const clang::FunctionDecl * ClassInfo__HasMethod(const clang::DeclContext *cl, char const *, const cling::Interpreter &interp)
Definition: TMetaUtils.cxx:696
std::set< const clang::Type * > TypesCont_t
Definition: TMetaUtils.h:129
static const std::string name("name")
const int kInfo
Definition: TMetaUtils.h:111
void SetPathsForRelocatability(std::vector< std::string > &clingArgs)
Organise the parameters for cling in order to guarantee relocatability It treats the gcc toolchain an...
bool operator<(const AnnotatedRecordDecl &right) const
Definition: TMetaUtils.h:275
EIOCtorCategory CheckConstructor(const clang::CXXRecordDecl *, const RConstructorType &)
Definition: TMetaUtils.cxx:973
Type
enumeration specifying the integration types.
bool NeedDestructor(clang::CXXRecordDecl const *)
RConstructorType(const char *type_of_arg, const cling::Interpreter &)
const clang::RecordDecl * fDecl
Definition: TMetaUtils.h:177
const int kSysError
Definition: TMetaUtils.h:116
void ExtractCtxtEnclosingNameSpaces(const clang::DeclContext &, std::list< std::pair< std::string, bool > > &)
Extract enclosing namespaces recusrively.
static const std::string persistent("persistent")
int type
Definition: TGX11.cxx:120
virtual bool GetPartiallyDesugaredNameWithScopeHandling(const std::string &tname, std::string &result)
We assume that we have a simple type: [const] typename[*&][const].
Definition: TMetaUtils.cxx:546
llvm::StringRef GetClassComment(const clang::CXXRecordDecl &decl, clang::SourceLocation *loc, const cling::Interpreter &interpreter)
Return the class comment after the ClassDef: class MyClass { ...
int FwdDeclFromFcnDecl(const clang::FunctionDecl &fcnDecl, const cling::Interpreter &interpreter, std::string &defString)
void Warning(const char *location, const char *va_(fmt),...)
Use this function in warning situations.
bool GetNameWithinNamespace(std::string &, std::string &, std::string &, clang::CXXRecordDecl const *)
Return true if one of the class' enclosing scope is a namespace and set fullname to the fully qualifi...
const std::string Decls2FwdDecls(const std::vector< const clang::Decl * > &decls, const cling::Interpreter &interp)
void SysError(const char *location, const char *va_(fmt),...)
Use this function in case a system (OS or GUI) related error occured.
bool EndsWith(const std::string &theString, const std::string &theSubstring)
const char * GetNormalizedName() const
Definition: TMetaUtils.h:249
const char * GetRequestedName() const
Definition: TMetaUtils.h:248
virtual bool IsDeclaredScope(const std::string &base, bool &isInlined)
Definition: TMetaUtils.cxx:527
cling::utils::Transform::Config Config_t
Definition: TMetaUtils.h:128
int ElementStreamer(std::ostream &finalString, const clang::NamedDecl &forcontext, const clang::QualType &qti, const char *t, int rwmode, const cling::Interpreter &interp, const char *tcl=0)
Definition: TMetaUtils.cxx:795
void LevelPrint(bool prefix, int level, const char *location, const char *fmt, va_list ap)
typedef void((*Func_t)())
llvm::StringRef GetComment(const clang::Decl &decl, clang::SourceLocation *loc=0)
Returns the comment (// striped away), annotating declaration in a meaningful for ROOT IO way...
bool IsBase(const clang::CXXRecordDecl *cl, const clang::CXXRecordDecl *base, const clang::CXXRecordDecl *context, const cling::Interpreter &interp)
Definition: TMetaUtils.cxx:752
clang::Module * declareModuleMap(clang::CompilerInstance *CI, const char *moduleFileName, const char *headers[])
Declare a virtual module.map to clang. Returns Module on success.
const int kFatal
Definition: TMetaUtils.h:117
void ReplaceAll(std::string &str, const std::string &from, const std::string &to, bool recurse=false)
std::string GetROOTIncludeDir(bool rootbuild)
int IsSTLContainer(const AnnotatedRecordDecl &annotated)
Is this an STL container.
const int kWarning
Definition: TMetaUtils.h:114
void keepTypedef(const cling::LookupHelper &lh, const char *name, bool replace=false)
Definition: TMetaUtils.cxx:352
clang::TemplateName ExtractTemplateNameFromQualType(const clang::QualType &qt)
These manipulations are necessary because a template specialisation type does not inherit from a reco...
bool QualType2Template(const clang::QualType &qt, clang::ClassTemplateDecl *&ctd, clang::ClassTemplateSpecializationDecl *&ctsd)
Get the template specialisation decl and template decl behind the qualtype Returns true if successful...
static const std::string ioname("ioname")
bool HasCustomOperatorNewArrayPlacement(clang::RecordDecl const &, const cling::Interpreter &interp)
return true if we can find a custom operator new with placement
double result[121]
AnnotatedRecordDecl(long index, const clang::RecordDecl *decl, bool rStreamerInfo, bool rNoStreamer, bool rRequestNoInputOperator, bool rRequestOnlyTClass, int rRequestedVersionNumber, const cling::Interpreter &interpret, const TNormalizedCtxt &normCtxt)
There is no requested type name.
Definition: TMetaUtils.cxx:364
bool IsOfType(const clang::CXXRecordDecl &cl, const std::string &type, const cling::LookupHelper &lh)
void WriteClassCode(CallWriteStreamer_t WriteStreamerFunc, const AnnotatedRecordDecl &cl, const cling::Interpreter &interp, const TNormalizedCtxt &normCtxt, std::ostream &finalString, const RConstructorTypes &ctorTypes, bool isGenreflex)
Generate the code of the class If the requestor is genreflex, request the new streamer format...
static void output(int code)
Definition: gifencode.c:226
const clang::CXXRecordDecl * fArgType
Definition: TMetaUtils.h:292
bool HasResetAfterMerge(clang::CXXRecordDecl const *, const cling::Interpreter &)
Return true if the class has a method ResetAfterMerge(TFileMergeInfo *)
bool HasCustomOperatorNewPlacement(char const *, clang::RecordDecl const &, const cling::Interpreter &)
return true if we can find a custom operator new with placement
clang::ClassTemplateDecl * QualType2ClassTemplateDecl(const clang::QualType &qt)
Extract from a qualtype the class template if this makes sense.
bool HasIOConstructor(clang::CXXRecordDecl const *, std::string &, const RConstructorTypes &, const cling::Interpreter &)
return true if we can find an constructor calleable without any arguments or with one the IOCtor spec...
void ExtractEnclosingNameSpaces(const clang::Decl &, std::list< std::pair< std::string, bool > > &)
Extract the immediately outer namespace and then launch the recursion.
clang::QualType GetNormalizedType(const clang::QualType &type, const cling::Interpreter &interpreter, const TNormalizedCtxt &normCtxt)
Return the type normalized for ROOT, keeping only the ROOT opaque typedef (Double32_t, etc.) and adding default template argument for all types except those explicitly requested to be drop by the user.
void Fatal(const char *location, const char *va_(fmt),...)
Use this function in case of a fatal error. It will abort the program.
TNormalizedCtxtImpl * fImpl
Definition: TMetaUtils.h:126
clang::QualType AddDefaultParameters(clang::QualType instanceType, const cling::Interpreter &interpret, const TNormalizedCtxt &normCtxt)
Add any unspecified template parameters to the class template instance, mentioned anywhere in the typ...